From 0ec3b80d6c524e879030c53c39f591e2a4332b3a Mon Sep 17 00:00:00 2001 From: Karchnu Date: Sat, 19 Dec 2020 03:32:43 +0100 Subject: [PATCH] Ignoring literals. --- src/parse.zig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/parse.zig b/src/parse.zig index fe2d10c..0c3d44c 100644 --- a/src/parse.zig +++ b/src/parse.zig @@ -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]) {