diff options
author | c+1 | 2023-05-12 12:30:28 -0400 |
---|---|---|
committer | c+1 | 2023-05-12 12:30:28 -0400 |
commit | ce63a4ea610bc80e9862c799633e07d3e896fe92 (patch) | |
tree | dc4b9a3ec4ab6c3f853bbc35b5fe89531431eb6d /src | |
parent | 17d6e6a265c44569f4533e12cc04442013ab3b3e (diff) |
reaoldhiajksld
Diffstat (limited to 'src')
-rw-r--r-- | src/lexer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lexer.c b/src/lexer.c index d8534c2..345d5c5 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -159,6 +159,7 @@ token_t* lexer_get_string(lexer_t* lexer) { token_t* lexer_get_comment(lexer_t* lexer) { lexer_next(lexer); + char* comment_so_far = calloc(1, sizeof(char)); while (lexer->c != ']') { @@ -220,10 +221,12 @@ token_t* lexer_get_directive(lexer_t* lexer) { } token_t* lexer_get_keyword(lexer_t* lexer) { + lexer_next(lexer); + char* str_so_far = calloc(1, sizeof(char)); str_so_far[0] = '\0'; - while (isalnum(lexer->c) || (lexer->c != '.' && lexer->c != ',')) { + while (isalnum(lexer->c)) { char* current = lexer_get_c_as_string(lexer); str_so_far = realloc(str_so_far, (strlen(str_so_far) + strlen(current) * sizeof(char))); strcat(str_so_far, current); |