This commit is contained in:
nub31
2026-02-09 20:49:09 +01:00
parent 96670b1201
commit ab9bd6fd05
9 changed files with 300 additions and 176 deletions

View File

@@ -347,8 +347,6 @@ public sealed class Tokenizer(string fileName, string contents)
"while" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.While),
"return" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Return),
"module" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Module),
"import" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Import),
"export" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Export),
"true" => new TokenBoolLiteral(line, startColumn, column - startColumn, true),
"false" => new TokenBoolLiteral(line, startColumn, column - startColumn, false),
_ => new TokenIdent(line, startColumn, column - startColumn, value)
@@ -482,8 +480,6 @@ public enum Keyword
While,
Return,
Module,
Import,
Export,
}
public sealed class TokenKeyword(int line, int column, int length, Keyword keyword) : Token(line, column, length)
@@ -546,8 +542,6 @@ public static class TokenExtensions
Keyword.While => "while",
Keyword.Return => "return",
Keyword.Module => "module",
Keyword.Import => "import",
Keyword.Export => "export",
_ => throw new ArgumentOutOfRangeException(nameof(symbol), symbol, null)
};
}