diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2024-07-09 14:18:48 +0100 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2024-07-09 14:18:48 +0100 |
commit | 3f23b452f8ab504a3337f88ddc714c3a660d2648 (patch) | |
tree | 04c06d2268567e2506f22254d3d4f5dc3d8f842a /comp/lucas-standen-NEA/code/execution/vars.c | |
parent | 4db750bbf03c9d7c18291fc63b7cf23cf966d6c8 (diff) |
started work on vars
Diffstat (limited to 'comp/lucas-standen-NEA/code/execution/vars.c')
-rw-r--r-- | comp/lucas-standen-NEA/code/execution/vars.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/comp/lucas-standen-NEA/code/execution/vars.c b/comp/lucas-standen-NEA/code/execution/vars.c new file mode 100644 index 0000000..db67c75 --- /dev/null +++ b/comp/lucas-standen-NEA/code/execution/vars.c @@ -0,0 +1,22 @@ +#include <string.h> +#include "../global/types.h" +#include "../global/util.h" +#include "../tokenizer/tokenizer.h" + +char *userVars[MAXVARS]; +long varCount = 0; + +literal *newVar(char *name, literal *value){ + userVars[varCount] = name; + varCount++; + literal *out = CheckedMalloc(sizeof(literal)); + +} + +literal *toLiteral(char *str){ + for (int i = 0; i < userVarCount; i++){ + if (strcmp(str, userDefinedVars[i]) == 0){ + + } + } +} |