C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html
This commit is contained in:
parent
9836f21d07
commit
b3b4cee1c5
|
@ -20590,8 +20590,8 @@ namespace exprtk
|
||||||
details::is_return_node(right_branch)
|
details::is_return_node(right_branch)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
free_node(node_allocator_, expression);
|
free_node(node_allocator_, expression);
|
||||||
free_node(node_allocator_,right_branch);
|
free_node(node_allocator_, right_branch);
|
||||||
|
|
||||||
set_error(
|
set_error(
|
||||||
make_error(parser_error::e_syntax,
|
make_error(parser_error::e_syntax,
|
||||||
|
@ -20623,7 +20623,8 @@ namespace exprtk
|
||||||
exprtk_error_location));
|
exprtk_error_location));
|
||||||
}
|
}
|
||||||
|
|
||||||
free_node(node_allocator_,expression);
|
free_node(node_allocator_, expression);
|
||||||
|
free_node(node_allocator_, right_branch);
|
||||||
|
|
||||||
return error_node();
|
return error_node();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2811,7 +2811,16 @@ inline bool run_test03()
|
||||||
"1 v x",
|
"1 v x",
|
||||||
"1 v y",
|
"1 v y",
|
||||||
"x v 1",
|
"x v 1",
|
||||||
"y v 1"
|
"y v 1",
|
||||||
|
|
||||||
|
"(x == 'a string' )",
|
||||||
|
"(x == 'a string'[1:2] )",
|
||||||
|
"(x == 'a string' + 'b string' )",
|
||||||
|
"(x == ('a string' + 'b string')[3:5])",
|
||||||
|
"('a string' == x )",
|
||||||
|
"('a string'[1:2] == x )",
|
||||||
|
"('a string' + 'b string' == x )",
|
||||||
|
"(('a string' + 'b string')[3:5] == x)"
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::size_t invalid_expr_size = sizeof(invalid_expr) / sizeof(std::string);
|
const std::size_t invalid_expr_size = sizeof(invalid_expr) / sizeof(std::string);
|
||||||
|
|
Loading…
Reference in New Issue