From da12cca68e56a8e75103a7a12b6cdb4299517b4e Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 9 Sep 2026 12:39:15 +0000 Subject: fix enum leaking and ast children conditions --- include/lexer/enum_type.h | 2 +- include/lexer/symbol_property.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/lexer/enum_type.h b/include/lexer/enum_type.h index e1c5b6f..bfc7cdc 100644 --- a/include/lexer/enum_type.h +++ b/include/lexer/enum_type.h @@ -25,7 +25,7 @@ enum guard_type GUARD_STRONG, }; -enum child_existance_type +enum class child_existence_type { NOT_EXIST, OPTIONAL, diff --git a/include/lexer/symbol_property.h b/include/lexer/symbol_property.h index 53120e0..a69d665 100644 --- a/include/lexer/symbol_property.h +++ b/include/lexer/symbol_property.h @@ -19,8 +19,8 @@ public: // require: MUST // accept: optional, but if it doesn't accept, but there is indeed a child, then error - child_existance_type left; - child_existance_type right; + child_existence_type left; + child_existence_type right; enum_token_type enum_type = TEXT; }; @@ -35,10 +35,10 @@ inline unordered_map symbol_property = { {")", {.continuable = false, .enum_type = RIGHT_BRACKET}}, // operator - {"&", {.operand_number = 1, .continuable = true, .pivot_priority = 2000, .left = EXIST, .right = NOT_EXIST, .enum_type = ASYNC}}, - {"|", {.operand_number = 1, .continuable = true, .pivot_priority = 100, .left = EXIST, .right = EXIST, .enum_type = PIPE}}, - {"&&", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .left = EXIST, .right = EXIST, .enum_type = LOGIC_AND}}, - {"||", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .left = EXIST, .right = EXIST, .enum_type = LOGIC_OR}}, + {"&", {.operand_number = 1, .continuable = true, .pivot_priority = 2000, .left = child_existence_type::EXIST, .right = child_existence_type::NOT_EXIST, .enum_type = ASYNC}}, + {"|", {.operand_number = 1, .continuable = true, .pivot_priority = 100, .left = child_existence_type::EXIST, .right = child_existence_type::EXIST, .enum_type = PIPE}}, + {"&&", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .left = child_existence_type::EXIST, .right = child_existence_type::EXIST, .enum_type = LOGIC_AND}}, + {"||", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .left = child_existence_type::EXIST, .right = child_existence_type::EXIST, .enum_type = LOGIC_OR}}, }; -- cgit v1.3.1-4-g156e