From 733cf587ffc21b2fbee7df7a8a42a1bc3c9a01e8 Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Wed, 2 Feb 2022 03:09:38 -0500 Subject: Use `type*` instead of `type&` to denote a pointer type (for now) While I prefer the latter, the lexer/parser cannot correctly parse `type&&` since it thinks `&&` is `TOKEN_AND`. Perhaps how these cases are handled can be changed in the future. --- src/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c index 5123189..85c4d6a 100644 --- a/src/parser.c +++ b/src/parser.c @@ -190,7 +190,7 @@ Type *parse_type(Lexer *lexer) type = type_new(TYPE_NONE); } - while (Lexer_peek(lexer).type == TOKEN_AMPERSAND) { + while (Lexer_peek(lexer).type == TOKEN_STAR) { Lexer_next(lexer); Type *ptr = type_new(TYPE_PTR); ptr->ptr = type; -- cgit v1.2.3