From ea71c42154aaa86c7961d5861c7479d1ffcda35c Mon Sep 17 00:00:00 2001 From: Daniel McCarthy Date: Thu, 7 Jul 2022 17:31:06 +0100 Subject: [PATCH] Lecture 113 - Fixing issue parsing strings --- parser.c | 10 ++++++++++ test | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/parser.c b/parser.c index 1d052f7..dc23aca 100644 --- a/parser.c +++ b/parser.c @@ -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(); @@ -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; } diff --git a/test b/test index e69de29..ad7942f 100644 --- a/test +++ b/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