From 3c35be76e515098431643155b66e61a1c64816ae Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 3 Jan 2023 13:19:58 -0800 Subject: done the parser in theory --- src/lexer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/lexer.c') 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; } -- cgit