Grooming, reading source info, parsing Class WIP.
parent
a93c718e1f
commit
0d9130ec89
3140
src/parse.zig
3140
src/parse.zig
File diff suppressed because it is too large
Load Diff
|
@ -12,6 +12,7 @@ pub const Token = struct {
|
|||
|
||||
pub const keywords = std.ComptimeStringMap(Id, .{
|
||||
.{ "property", .Keyword_property },
|
||||
.{ "define", .Keyword_define },
|
||||
.{ "require", .Keyword_require },
|
||||
.{ "false", .Keyword_false },
|
||||
.{ "null", .Keyword_null },
|
||||
|
@ -100,6 +101,7 @@ pub const Token = struct {
|
|||
ShebangLine,
|
||||
|
||||
Keyword_property,
|
||||
Keyword_define,
|
||||
Keyword_require,
|
||||
Keyword_false,
|
||||
Keyword_null,
|
||||
|
@ -184,6 +186,7 @@ pub const Token = struct {
|
|||
.Tilde => "~",
|
||||
|
||||
.Keyword_property => "property",
|
||||
.Keyword_define => "define",
|
||||
.Keyword_require => "require",
|
||||
.Keyword_false => "false",
|
||||
.Keyword_null => "null",
|
||||
|
@ -565,7 +568,9 @@ pub const Tokenizer = struct {
|
|||
},
|
||||
|
||||
.identifier => switch (c) {
|
||||
'a'...'z', 'A'...'Z', '_', '0'...'9' => {},
|
||||
// Include "-" as an identifer token, this is the only difference
|
||||
// with the Zig tokenizer.
|
||||
'a'...'z', 'A'...'Z', '_', '-', '0'...'9' => {},
|
||||
else => {
|
||||
if (Token.getKeyword(self.buffer[result.loc.start..self.index])) |id| {
|
||||
result.id = id;
|
||||
|
|
Loading…
Reference in New Issue