diff options
| author | Mustafa Quraish <[email protected]> | 2022-02-02 03:09:38 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-02-02 03:09:38 -0500 |
| commit | 733cf587ffc21b2fbee7df7a8a42a1bc3c9a01e8 (patch) | |
| tree | 68c89184499cf04b9970624108c1212745672666 /src/parser.c | |
| parent | Add support for pointers! (tests missing) (diff) | |
| download | cup-733cf587ffc21b2fbee7df7a8a42a1bc3c9a01e8.tar.xz cup-733cf587ffc21b2fbee7df7a8a42a1bc3c9a01e8.zip | |
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.
Diffstat (limited to 'src/parser.c')
| -rw-r--r-- | src/parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |