Skip to content

Commit

Permalink
Lecture 113 - Fixing issue parsing strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonzapeducation committed Jul 7, 2022
1 parent 8a24240 commit ea71c42
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions parser.c
Expand Up @@ -1800,6 +1800,11 @@ void parse_keyword(struct history *history)
compiler_error(current_process, "Invalid keyword\n");
}

void parse_string(struct history* history)
{
parse_single_token_to_node();
}

int parse_expressionable_single(struct history *history)
{
struct token *token = token_peek_next();
Expand Down Expand Up @@ -1831,6 +1836,11 @@ int parse_expressionable_single(struct history *history)
parse_keyword(history);
res = 0;
break;

case TOKEN_TYPE_STRING:
parse_string(history);
res = 0;
break;
}
return res;
}
Expand Down
6 changes: 6 additions & 0 deletions test
@@ -0,0 +1,6 @@
section .data
; char hello
hello: db str_1
section .text
section .rodata
str_1: db 'h', 'e', 'l', 'l', 'o', 0

0 comments on commit ea71c42

Please sign in to comment.