diff options
| author | Mistivia <i@mistivia.com> | 2025-03-19 23:41:13 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-03-19 23:41:38 +0800 |
| commit | 48f36f70413c944be9c764e846a1017dd00c63ec (patch) | |
| tree | 4e8321ad9dc4a4716fcd88220d689babe8f397d5 /src/as_tokenizer.c | |
| parent | afb5ae7905c666eb259288ba0d3b47f71a13958f (diff) | |
add complete op list
Diffstat (limited to 'src/as_tokenizer.c')
| -rw-r--r-- | src/as_tokenizer.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/as_tokenizer.c b/src/as_tokenizer.c index 4cb695e..4a5353a 100644 --- a/src/as_tokenizer.c +++ b/src/as_tokenizer.c @@ -3,6 +3,7 @@ #include <string.h> #include "as_tokenizer.h" +#include "as_op.h" #include "utils.h" int InputStream_nextChar(InputStream s) { @@ -44,19 +45,6 @@ int InputStream_peekChar(InputStream s) { return s->buf[s->cursor]; } -char* ops[] = { - "add", "sub", "mul", "div", "mod", "eq" -}; - -int isOp(const char* str) { - for (int i = 0; i < sizeof(ops) / sizeof(ops[0]); i++) { - if (strcmp(ops[i], str) == 0) { - return 1; - } - } - return 0; -} - int isStartOfIndentifier(int c) { if (c >= 'a' && c <= 'z') { return 1; |
