extern
This commit is contained in:
@@ -397,6 +397,7 @@ public class Tokenizer
|
||||
"return" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Return),
|
||||
"module" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Module),
|
||||
"export" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Export),
|
||||
"extern" => new TokenKeyword(line, startColumn, column - startColumn, Keyword.Extern),
|
||||
"true" => new TokenBoolLiteral(line, startColumn, column - startColumn, true),
|
||||
"false" => new TokenBoolLiteral(line, startColumn, column - startColumn, false),
|
||||
_ => new TokenIdent(line, startColumn, column - startColumn, value)
|
||||
@@ -545,6 +546,7 @@ public enum Keyword
|
||||
Return,
|
||||
Module,
|
||||
Export,
|
||||
Extern,
|
||||
}
|
||||
|
||||
public class TokenKeyword(int line, int column, int length, Keyword keyword) : Token(line, column, length)
|
||||
@@ -611,6 +613,7 @@ public static class TokenExtensions
|
||||
Keyword.Return => "return",
|
||||
Keyword.Module => "module",
|
||||
Keyword.Export => "export",
|
||||
Keyword.Extern => "extern",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(symbol), symbol, null)
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user