diff options
Diffstat (limited to 'comp/lucas-standen-NEA/code2/tokenizer.c')
-rw-r--r-- | comp/lucas-standen-NEA/code2/tokenizer.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/comp/lucas-standen-NEA/code2/tokenizer.c b/comp/lucas-standen-NEA/code2/tokenizer.c index 7e8cae1..c756c0c 100644 --- a/comp/lucas-standen-NEA/code2/tokenizer.c +++ b/comp/lucas-standen-NEA/code2/tokenizer.c @@ -63,7 +63,20 @@ top: head->children[argCount] = tokenize(chunk); argCount++; }else { - i += readuntil(&line[i], ' ', chunk); // reads func name or arg + if (line[i] == '"'){ + i += readuntil(&line[i+1], '"', chunk); // reads a comptime string + i++; + char *tmp = malloc(strlen(chunk)+2); + tmp[0] = '"'; + tmp[1] = '\0'; + strcat(tmp, chunk); + strcat(tmp, "\""); + chunk = tmp; + + } + else { + i += readuntil(&line[i], ' ', chunk); // reads func name or arg + } if (head->func == NULL){ head->func = chunk; } else{ |