From 6818776dd5866ff07938cbdf8dbfdf6cea62fe34 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Mon, 7 Jul 2025 23:50:06 +0200 Subject: Bootstrap: Codegen: Support bool types --- src/bootstrap/parser.pry | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/bootstrap/parser.pry') diff --git a/src/bootstrap/parser.pry b/src/bootstrap/parser.pry index 8bc1c2e..63d17c8 100644 --- a/src/bootstrap/parser.pry +++ b/src/bootstrap/parser.pry @@ -523,6 +523,15 @@ let parser_parse_primary_expression = (p: *parser) => *Node { return create_node(p, n); }; + if (*tok).type == TOKEN_BOOLEAN { + let d = cast(*NODE_PRIMARY_EXPRESSION_BOOLEAN_DATA, arena_alloc((*p).arena, sizeof(NODE_PRIMARY_EXPRESSION_BOOLEAN_DATA))); + (*d).value = *(cast(*bool, (*tok).data)); + let n = Node{}; + n.type = NODE_PRIMARY_EXPRESSION_BOOLEAN; + n.data = cast(*void, d); + return create_node(p, n); + }; + if (*tok).type == TOKEN_STRING { let d = cast(*NODE_PRIMARY_EXPRESSION_STRING_DATA, arena_alloc((*p).arena, sizeof(NODE_PRIMARY_EXPRESSION_STRING_DATA))); (*d).value = cast(*i8, (*tok).data); -- cgit 1.4.1