diff options
Diffstat (limited to 'include/lexer/symbol_property.h')
| -rw-r--r-- | include/lexer/symbol_property.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/lexer/symbol_property.h b/include/lexer/symbol_property.h index 2e94cf7..caff263 100644 --- a/include/lexer/symbol_property.h +++ b/include/lexer/symbol_property.h @@ -40,5 +40,22 @@ unordered_map<string, T_property> symbol_property = { {"||", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .left = EXIST, .right = EXIST, .enum_type = LOGIC_OR}}, }; + +string symbol_enum2string(enum_token_type e) +{ + for (auto &c : symbol_property) + { + // pair<string, T_property> + + if (c.second.enum_type == e) + return c.first; + } + return ""; +} + +bool symbol_contains_enum_type(enum_token_type e) +{ + return (symbol_enum2string(e) == "") ? false : true; +} } |
