Ignoring literals.

mess
Karchnu 2020-12-19 03:32:43 +01:00
parent 8a0abd070e
commit 0ec3b80d6c
1 changed files with 9 additions and 1 deletions

View File

@ -218,7 +218,7 @@ const Parser = struct {
},
else => {
std.debug.print("token: {}\n", .{p.token_ids[token]});
p.say("unexpected token: {}\n", .{p.token_ids[token]});
continue;
},
}
@ -297,6 +297,14 @@ const Parser = struct {
// p.say("within a node, token: {}\n", .{p.giveTokenContent(token)});
switch (p.token_ids[token]) {
.Keyword_null,
.StringLiteral,
.FloatLiteral,
.IntegerLiteral => {
p.say("reading (and ignoring) a literal: {}\n", .{p.giveTokenContent(token)});
continue;
},
.Identifier => {
const following = p.nextToken();
switch (p.token_ids[following]) {