diff options
author | Marvin Borner | 2021-04-21 00:05:04 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-21 00:05:04 +0200 |
commit | c219c38e854fe15bc47519d2df0d6cbd7bab2ab7 (patch) | |
tree | 239b84c05371b4e853b40ebb52b1ad744fe0fc53 /src/lexer.c | |
parent | f31fc8b66eee149bd78603996f34264be8fad411 (diff) |
Started syntax highlighting
doesn't work but don't want to fix lel.
Diffstat (limited to 'src/lexer.c')
-rw-r--r-- | src/lexer.c | 6 |
1 files changed, 5 insertions, 1 deletions
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++; + } } } |