From 9a97a4ed18d7814c12448e6a747f81eb03e894cf Mon Sep 17 00:00:00 2001 From: Baitinq Date: Mon, 7 Jul 2025 23:57:54 +0200 Subject: Bootstrap: Codegen: Support char 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 63d17c8..be1ffb7 100644 --- a/src/bootstrap/parser.pry +++ b/src/bootstrap/parser.pry @@ -532,6 +532,15 @@ let parser_parse_primary_expression = (p: *parser) => *Node { return create_node(p, n); }; + if (*tok).type == TOKEN_CHAR { + let d = cast(*NODE_PRIMARY_EXPRESSION_CHAR_DATA, arena_alloc((*p).arena, sizeof(NODE_PRIMARY_EXPRESSION_CHAR_DATA))); + (*d).value = *(cast(*i8, (*tok).data)); + let n = Node{}; + n.type = NODE_PRIMARY_EXPRESSION_CHAR; + 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