Fix a bug that produced a lot of NONEs in the syntaxtree

This commit is contained in:
bʰedoh₂ swé 2024-06-09 22:24:58 +05:00
parent 96acb9df26
commit 6e1de39a2e

View File

@ -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;