summaryrefslogtreecommitdiff
path: root/comp/lucas-standen-NEA/code2/tokenizer.c
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2024-10-01 08:55:32 +0100
committerthing1 <thing1@seacrossedlovers.xyz>2024-10-01 08:55:32 +0100
commitef8cf00bbf9f74eb3b6aabc1d99f5358e81741c7 (patch)
tree3479ca1b82573426151cb270c63a588af737d3c0 /comp/lucas-standen-NEA/code2/tokenizer.c
parentdc7732b6f073d5450657d94c815ca445a1a08fbd (diff)
added some cool examples to zpy and got electronics working
Diffstat (limited to 'comp/lucas-standen-NEA/code2/tokenizer.c')
-rw-r--r--comp/lucas-standen-NEA/code2/tokenizer.c15
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{