From 6e1de39a2e47818b5392ddf5722381e56f9f70ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Sun, 9 Jun 2024 22:24:58 +0500 Subject: [PATCH] Fix a bug that produced a lot of NONEs in the syntaxtree --- src/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.c b/src/parser.c index 609402b..cd1c361 100644 --- a/src/parser.c +++ b/src/parser.c @@ -37,7 +37,6 @@ tSyntaxElement* parse(FILE* file) { continue; } if (instring) { - syntaxtree = se_next(syntaxtree); if (symbol == '"') { if (extstring == NULL) { extstring = malloc(sizeof(tExtstring)); @@ -61,7 +60,6 @@ tSyntaxElement* parse(FILE* file) { continue; } if (intoken) { - syntaxtree = se_next(syntaxtree); if (isspace(symbol) || symbol == '(' || symbol == ')') { intoken = false; syntaxtree->type = TOKEN; @@ -93,9 +91,11 @@ tSyntaxElement* parse(FILE* file) { incomment = true; continue; case '"': + syntaxtree = se_next(syntaxtree); instring = true; continue; default: + syntaxtree = se_next(syntaxtree); exttoken = malloc(sizeof(tExtstring)); exttoken->symbol = symbol; exttoken->next = NULL;