diff options
| author | _ov4 <ov4@ov4.org> | 2026-09-09 09:05:21 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-09-09 09:05:21 +0000 |
| commit | c7bf5df4b1faf8493bb431bbe23e9f182153ddbb (patch) | |
| tree | 0be5cff947bee957de6daa6ead9f1c115ae4f39d /include/lexer/ast.h | |
| parent | 992487d4e425db4443b6f692f349e61de78ea43e (diff) | |
symbol enum converter
Diffstat (limited to 'include/lexer/ast.h')
| -rw-r--r-- | include/lexer/ast.h | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/include/lexer/ast.h b/include/lexer/ast.h index 59c1e4b..ea26d5d 100644 --- a/include/lexer/ast.h +++ b/include/lexer/ast.h @@ -45,23 +45,13 @@ size_t alloc_ast() int get_pivot_order(enum_token_type x) { - switch(x) + string s = symbol_enum2string(x); + if (s != "") { - case ASYNC: - case SEMICOLON: - return 1000; - - case LOGIC_AND: - case LOGIC_OR: - return 500; - - case PIPE: - return 100; - - default: - return 0; + return symbol_property[s].pivot_priority; } - return 0; + // not found + return -1; } bool is_operator(enum_token_type x) |
