Remove namespace

I don't think namespaces are technically deprecated, but they're an unnecessary typescript-only feature that we're using in exactly one place, so let's stop.
This commit is contained in:
Jason Fields 2021-04-18 19:18:37 -04:00
parent bb56b499fa
commit 9487360e59
2 changed files with 197 additions and 200 deletions

View File

@ -8,7 +8,7 @@ export function lex(input: string): Token[] {
// We use a character scanner as state for the lexer.
const state = new Scanner(input);
const tokens: Token[] = [];
let f: ILexFunction | null = LexerFunctions.lexRange;
let f: ILexFunction | null = lexRange;
while (f) {
// Each lexing function returns the next lexing function or null.
f = f(state, tokens);
@ -22,9 +22,8 @@ function emitToken(type: TokenType, state: Scanner): Token | null {
return content.length > 0 ? new Token(type, content) : null;
}
namespace LexerFunctions {
// Starts lexing a Vim command line and delegates on other lexer functions as needed.
export function lexRange(state: Scanner, tokens: Token[]): ILexFunction | null {
function lexRange(state: Scanner, tokens: Token[]): ILexFunction | null {
while (true) {
if (state.isAtEof) {
break;
@ -231,4 +230,3 @@ namespace LexerFunctions {
}
return lexRange;
}
}

View File

@ -6,7 +6,6 @@
"max-classes-per-file": false,
"no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
"no-duplicate-variable": true,
"no-namespace": false,
"no-parameter-properties": true,
"no-return-await": true,
"no-switch-case-fall-through": true,