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_parser.c | |
| parent | afb5ae7905c666eb259288ba0d3b47f71a13958f (diff) | |
add complete op list
Diffstat (limited to 'src/as_parser.c')
| -rw-r--r-- | src/as_parser.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/as_parser.c b/src/as_parser.c index 990bc1c..17d0b87 100644 --- a/src/as_parser.c +++ b/src/as_parser.c @@ -14,7 +14,7 @@ // <stmt> ::= <label> <instr> | <instr> | <label> // <instr> ::= <op> | <op> arg | <op> tag // <label> ::= tag ":" -// <op> ::= "add" | "sub" | "mul" | "div" | "mod" | "eq" +// <op> ::= "add" | "sub" | "mul" | "div" | "mod" | "eq" | ... Prog parseProg(Allocator alct, TokenStream ts) { @@ -98,7 +98,7 @@ enum op parseOp(Allocator alct, TokenStream ts) { enum op op; if (t->type == OP) { op = str2op(t->sval); - if (op == OPEND) { + if (op == OP_END) { fprintf(stderr, "%d:%d Invalid OP.\n", t->line, t->col); exit(-1); } @@ -114,7 +114,7 @@ Instr parseInstr(Allocator alct, TokenStream ts) { Instr i = allocate(alct, sizeof(struct instr)); i->tagName = NULL; i->arg = NULL; - i->op = OPEND; + i->op = OP_END; if (t->type == OP) { i->op = parseOp(alct, ts); t = peekToken(alct, ts); |
