diff options
| author | Mustafa Quraish <[email protected]> | 2022-02-03 21:01:03 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-02-03 21:01:03 -0500 |
| commit | 9f3edcbeea51dd8841b9d89fa7ef98f11682a1c7 (patch) | |
| tree | b2a4b6fa51ad558b36facde2cf952a6af5a25669 /src/lexer.c | |
| parent | Add automatic type inference for initialized variable declarations (diff) | |
| download | archived-cup-9f3edcbeea51dd8841b9d89fa7ef98f11682a1c7.tar.xz archived-cup-9f3edcbeea51dd8841b9d89fa7ef98f11682a1c7.zip | |
Add support for basic structs
Structs for now (and probably for the near future) are not allowed
to be passed by value, and instead you just pass a pointer to it.
Nested structs can also be defined, and they can be either anonymous,
or named (in which case only the members can access the type).
Diffstat (limited to 'src/lexer.c')
| -rw-r--r-- | src/lexer.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lexer.c b/src/lexer.c index d1201b2..f02ef94 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -128,6 +128,7 @@ Token Lexer_next(Lexer *lexer) case ':': return Lexer_make_token(lexer, TOKEN_COLON, 1); case '~': return Lexer_make_token(lexer, TOKEN_TILDE, 1); case '?': return Lexer_make_token(lexer, TOKEN_QUESTION, 1); + case '.': return Lexer_make_token(lexer, TOKEN_DOT, 1); case ',': return Lexer_make_token(lexer, TOKEN_COMMA, 1); case '*': return Lexer_make_token(lexer, TOKEN_STAR, 1); case '%': return Lexer_make_token(lexer, TOKEN_PERCENT, 1); |