diff options
author | Thing1 <thing1@seacrossedlovers.xyz> | 2024-08-27 10:36:18 +0100 |
---|---|---|
committer | Thing1 <thing1@seacrossedlovers.xyz> | 2024-08-27 10:36:18 +0100 |
commit | cfdd3c90877b59dc674cc9f68c0b7b4bb7c14ba8 (patch) | |
tree | aae4a0d071df72947e8a50d88027071b3473bb12 /comp/lucas-standen-NEA/code | |
parent | 7dad37effbeaf44ec12d2ae2fcf1643d4d4351b2 (diff) |
rewrite
Diffstat (limited to 'comp/lucas-standen-NEA/code')
-rwxr-xr-x | comp/lucas-standen-NEA/code/execution/exec | bin | 42120 -> 37792 bytes | |||
-rwxr-xr-x | comp/lucas-standen-NEA/code/proto/AST/ast | bin | 24200 -> 19888 bytes | |||
-rwxr-xr-x | comp/lucas-standen-NEA/code/proto/parser/test | bin | 29728 -> 25464 bytes | |||
-rw-r--r-- | comp/lucas-standen-NEA/code/tokenizer/parser.c | 5 | ||||
-rwxr-xr-x | comp/lucas-standen-NEA/code/zpy/zpy | bin | 30432 -> 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 Binary files differindex de1cd68..d69d951 100755 --- a/comp/lucas-standen-NEA/code/execution/exec +++ b/comp/lucas-standen-NEA/code/execution/exec diff --git a/comp/lucas-standen-NEA/code/proto/AST/ast b/comp/lucas-standen-NEA/code/proto/AST/ast Binary files differindex 69ccc93..be44ef5 100755 --- a/comp/lucas-standen-NEA/code/proto/AST/ast +++ b/comp/lucas-standen-NEA/code/proto/AST/ast diff --git a/comp/lucas-standen-NEA/code/proto/parser/test b/comp/lucas-standen-NEA/code/proto/parser/test Binary files differindex 6989562..6945399 100755 --- a/comp/lucas-standen-NEA/code/proto/parser/test +++ b/comp/lucas-standen-NEA/code/proto/parser/test 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 Binary files differindex f3a466f..53c09ad 100755 --- a/comp/lucas-standen-NEA/code/zpy/zpy +++ b/comp/lucas-standen-NEA/code/zpy/zpy |