From c219c38e854fe15bc47519d2df0d6cbd7bab2ab7 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 21 Apr 2021 00:05:04 +0200 Subject: Started syntax highlighting doesn't work but don't want to fix lel. --- src/lexer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lexer.c') diff --git a/src/lexer.c b/src/lexer.c index d4a6d6a..5b43cb5 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -37,8 +37,10 @@ struct token token_resolve(char *str, u32 size) if (str[length] == 'h' || str[length] == 'H') { type = HEX_NUM; + length++; } else if (str[length] == 'b' || str[length] == 'B') { type = BIN_NUM; + length++; } else { type = DEC_NUM; } @@ -263,8 +265,10 @@ struct token token_resolve(char *str, u32 size) while (ALPHA_NUMERIC(str[length])) length++; - if (length) + if (length) { type = STRING; + length++; + } } } -- cgit v1.2.3