From c7bf5df4b1faf8493bb431bbe23e9f182153ddbb Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 9 Sep 2026 09:05:21 +0000 Subject: symbol enum converter --- include/lexer/ast.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'include/lexer/ast.h') 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) -- cgit v1.3.1-4-g156e