rework syntax checks, rework priority correction algorithm

This commit is contained in:
2026-10-14 19:57:02 +03:00
parent 433ee2bb2e
commit 84d28d3845
4 changed files with 870 additions and 525 deletions
+1 -5
View File
@@ -10,15 +10,11 @@ int main(int argc, char **argv)
std::vector<Expression::Token> tv = Parser::tokenize_input(argv[1]);
Syntax::pre_process(tv);
if (Syntax::check_syntax(tv))
if (Syntax::prepare_token_vector(tv))
{
return 0;
}
Syntax::post_process(tv);
std::vector<Expression::Operation> ov = Syntax::build_op_vector(tv);
Expression::TreeNode root = Syntax::ov_to_tree(tv, ov);
+864 -516
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -99,7 +99,10 @@ TEST(tree_proper_test_1)
TEST(tree_proper_test_2)
{
std::vector<Expression::Token> o = Parser::tokenize_input("(1**5 * (1-2-3-4-5-6-7-8))");
Syntax::post_process(o);
if (Syntax::prepare_token_vector(o))
{
return 1;
}
std::vector<Expression::Operation> ov = Syntax::build_op_vector(o);
return 0;