From 4464bc5ba664aa1acda674df76fda7524bc16726 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 8 Sep 2026 11:40:04 +0000 Subject: refactor --- include/lexer/symbol_property.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'include/lexer/symbol_property.h') diff --git a/include/lexer/symbol_property.h b/include/lexer/symbol_property.h index 24f30c1..3d85623 100644 --- a/include/lexer/symbol_property.h +++ b/include/lexer/symbol_property.h @@ -15,19 +15,23 @@ public: int operand_number = 0; bool continuable = true; int pivot_priority = -1; - enum_token_type type = TEXT; + enum_token_type enum_type = TEXT; }; unordered_map symbol_property = { // non-operator - {"\'", {.type = SINGLE_QUOTATION}}, - {"\"", {.type = SINGLE_QUOTATION}}, + {"\'", {.enum_type = SINGLE_QUOTATION}}, + {"\"", {.enum_type = SINGLE_QUOTATION}}, + + // bracket + {"(", {.continuable = false, .enum_type = LEFT_BRACKET}}, + {")", {.continuable = false, .enum_type = RIGHT_BRACKET}}, // operator - {"&", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .type = ASYNC}}, - {"|", {.operand_number = 1, .continuable = true, .pivot_priority = 100, .type = PIPE}}, - {"&&", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .type = LOGIC_AND}}, - {"||", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .type = LOGIC_OR}}, + {"&", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .enum_type = ASYNC}}, + {"|", {.operand_number = 1, .continuable = true, .pivot_priority = 100, .enum_type = PIPE}}, + {"&&", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .enum_type = LOGIC_AND}}, + {"||", {.operand_number = 1, .continuable = true, .pivot_priority = 1000, .enum_type = LOGIC_OR}}, }; } -- cgit v1.3.1-4-g156e