summaryrefslogtreecommitdiff
path: root/src/lexer.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2023-01-03 13:19:58 -0800
committerPreston Pan <preston@nullring.xyz>2023-01-03 13:19:58 -0800
commit3c35be76e515098431643155b66e61a1c64816ae (patch)
tree4a11454acce1965c52e511dd44dba2e1dd73ee67 /src/lexer.c
parentb2c539fadfa7ea3eea2e5f7c0c37b5f5f1370c5a (diff)
done the parser in theory
Diffstat (limited to 'src/lexer.c')
-rw-r--r--src/lexer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lexer.c b/src/lexer.c
index 02417a1..938c4eb 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -63,11 +63,13 @@ static char *char_to_string(char c) {
token_t *lexer_collect_bool(lexer_t *lexer) {
lexer_move(lexer);
- if (lexer->c == 't')
+ if (lexer->c == 't') {
+ lexer_move(lexer);
return init_token(TOKEN_BOOL, "T", lexer->row, lexer->col);
- else if (lexer->c == 'f')
+ } else if (lexer->c == 'f') {
+ lexer_move(lexer);
return init_token(TOKEN_BOOL, "F", lexer->row, lexer->col);
- else
+ } else
return NULL;
}