summaryrefslogtreecommitdiff
path: root/comp/lucas-standen-NEA/code
diff options
context:
space:
mode:
authorThing1 <thing1@seacrossedlovers.xyz>2024-08-27 10:36:18 +0100
committerThing1 <thing1@seacrossedlovers.xyz>2024-08-27 10:36:18 +0100
commitcfdd3c90877b59dc674cc9f68c0b7b4bb7c14ba8 (patch)
treeaae4a0d071df72947e8a50d88027071b3473bb12 /comp/lucas-standen-NEA/code
parent7dad37effbeaf44ec12d2ae2fcf1643d4d4351b2 (diff)
rewrite
Diffstat (limited to 'comp/lucas-standen-NEA/code')
-rwxr-xr-xcomp/lucas-standen-NEA/code/execution/execbin42120 -> 37792 bytes
-rwxr-xr-xcomp/lucas-standen-NEA/code/proto/AST/astbin24200 -> 19888 bytes
-rwxr-xr-xcomp/lucas-standen-NEA/code/proto/parser/testbin29728 -> 25464 bytes
-rw-r--r--comp/lucas-standen-NEA/code/tokenizer/parser.c5
-rwxr-xr-xcomp/lucas-standen-NEA/code/zpy/zpybin30432 -> 30272 bytes
5 files changed, 3 insertions, 2 deletions
diff --git a/comp/lucas-standen-NEA/code/execution/exec b/comp/lucas-standen-NEA/code/execution/exec
index de1cd68..d69d951 100755
--- a/comp/lucas-standen-NEA/code/execution/exec
+++ b/comp/lucas-standen-NEA/code/execution/exec
Binary files differ
diff --git a/comp/lucas-standen-NEA/code/proto/AST/ast b/comp/lucas-standen-NEA/code/proto/AST/ast
index 69ccc93..be44ef5 100755
--- a/comp/lucas-standen-NEA/code/proto/AST/ast
+++ b/comp/lucas-standen-NEA/code/proto/AST/ast
Binary files differ
diff --git a/comp/lucas-standen-NEA/code/proto/parser/test b/comp/lucas-standen-NEA/code/proto/parser/test
index 6989562..6945399 100755
--- a/comp/lucas-standen-NEA/code/proto/parser/test
+++ b/comp/lucas-standen-NEA/code/proto/parser/test
Binary files differ
diff --git a/comp/lucas-standen-NEA/code/tokenizer/parser.c b/comp/lucas-standen-NEA/code/tokenizer/parser.c
index 78ba919..b2c3657 100644
--- a/comp/lucas-standen-NEA/code/tokenizer/parser.c
+++ b/comp/lucas-standen-NEA/code/tokenizer/parser.c
@@ -57,7 +57,7 @@ FILE *preProcess(char *contents){
}
char **getExpressions(char *file){ // this doesn't work because str gets overwritten which changes the data stored at it's pointer, memcpy should be used
- char **code = CheckedMalloc((strlen(file)/2)*sizeof(char *));
+ char **code = CheckedMalloc(strlen(file)/4);
int counter = 0;
int depth = 0;
char *str = CheckedMalloc(strlen(file)+1);
@@ -73,7 +73,8 @@ char **getExpressions(char *file){ // this doesn't work because str gets overwri
if (depth == 0) {
str[pos] = '\0';
printf("%s\n", str);
- code[counter] = str;
+ code[counter] = malloc(strlen(str)+1);
+ memcpy(code[counter], str, strlen((str)+1));
counter++;
pos = 0;
}
diff --git a/comp/lucas-standen-NEA/code/zpy/zpy b/comp/lucas-standen-NEA/code/zpy/zpy
index f3a466f..53c09ad 100755
--- a/comp/lucas-standen-NEA/code/zpy/zpy
+++ b/comp/lucas-standen-NEA/code/zpy/zpy
Binary files differ