rework syntax checks, rework priority correction algorithm
This commit is contained in:
+1
-5
@@ -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
File diff suppressed because it is too large
Load Diff
+4
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user