This commit is contained in:
2026-02-08 00:53:55 +01:00
parent f2ea00b34d
commit 26d365cf4f
4 changed files with 110 additions and 44 deletions

View File

@@ -279,6 +279,7 @@ public sealed class Tokenizer(string contents)
"func" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Func),
"let" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Let),
"if" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.If),
"return" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Return),
"true" => new TokenBoolLiteral(line, startColumn, column - startColumn, true),
"false" => new TokenBoolLiteral(line, startColumn, column - startColumn, false),
_ => new TokenIdent(line, startColumn, column - startColumn, value)
@@ -397,6 +398,7 @@ public enum Keyword
Func,
Let,
If,
Return,
}
public sealed class TokenKeyword(int line, int column, int length, Keyword keyword) : Token(line, column, length)