C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html

This commit is contained in:
Arash Partow
2017-04-12 19:32:00 +10:00
parent a2af37c630
commit 874d8732fd

View File

@ -22632,6 +22632,26 @@ namespace exprtk
return error_node(); return error_node();
} }
// Perform compile-time range check
if (details::is_constant_node(index_expr))
{
const std::size_t index = std::size_t(index_expr->value());
const std::size_t vec_size = vec->size();
if (index >= vec_size)
{
set_error(
make_error(parser_error::e_syntax,
current_token(),
"ERR106 - Index of " + details::to_str(index) + " out of range for "
"vector '" + symbol + "' of size " + details::to_str(vec_size)));
free_node(node_allocator_,index_expr);
return error_node();
}
}
return expression_generator_.vector_element(symbol,vec,index_expr); return expression_generator_.vector_element(symbol,vec,index_expr);
} }
@ -22653,7 +22673,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR106 - Zero parameter call to vararg function: " "ERR107 - Zero parameter call to vararg function: "
+ vararg_function_name + " not allowed")); + vararg_function_name + " not allowed"));
return error_node(); return error_node();
@ -22677,7 +22697,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR107 - Expected ',' for call to vararg function: " "ERR108 - Expected ',' for call to vararg function: "
+ vararg_function_name)); + vararg_function_name));
return error_node(); return error_node();
@ -22690,7 +22710,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR108 - Zero parameter call to vararg function: " "ERR109 - Zero parameter call to vararg function: "
+ vararg_function_name + " not allowed")); + vararg_function_name + " not allowed"));
return error_node(); return error_node();
@ -22701,7 +22721,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR109 - Invalid number of parameters to call to vararg function: " "ERR110 - Invalid number of parameters to call to vararg function: "
+ vararg_function_name + ", require at least " + vararg_function_name + ", require at least "
+ details::to_str(static_cast<int>(vararg_function->min_num_args())) + " parameters")); + details::to_str(static_cast<int>(vararg_function->min_num_args())) + " parameters"));
@ -22712,7 +22732,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR110 - Invalid number of parameters to call to vararg function: " "ERR111 - Invalid number of parameters to call to vararg function: "
+ vararg_function_name + ", require no more than " + vararg_function_name + ", require no more than "
+ details::to_str(static_cast<int>(vararg_function->max_num_args())) + " parameters")); + details::to_str(static_cast<int>(vararg_function->max_num_args())) + " parameters"));
@ -22774,7 +22794,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
parser_.current_token(), parser_.current_token(),
"ERR111 - Failed parameter type check for function '" + function_name_ + "', " "ERR112 - Failed parameter type check for function '" + function_name_ + "', "
"Expected '" + param_seq_list_[0] + "' call set: '" + param_seq +"'")); "Expected '" + param_seq_list_[0] + "' call set: '" + param_seq +"'"));
} }
else else
@ -22794,7 +22814,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
parser_.current_token(), parser_.current_token(),
"ERR112 - Failed parameter type check for function '" + function_name_ + "', " "ERR113 - Failed parameter type check for function '" + function_name_ + "', "
"Best match: '" + param_seq_list_[max_diff_index] + "' call set: '" + param_seq +"'")); "Best match: '" + param_seq_list_[max_diff_index] + "' call set: '" + param_seq +"'"));
} }
@ -22878,7 +22898,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
parser_.current_token(), parser_.current_token(),
"ERR113 - Invalid parameter sequence of '" + err_param_seq + "ERR114 - Invalid parameter sequence of '" + err_param_seq +
"' for function: " + function_name_)); "' for function: " + function_name_));
return; return;
@ -22899,7 +22919,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
parser_.current_token(), parser_.current_token(),
"ERR114 - Invalid parameter sequence of '" + err_param_seq + "ERR115 - Invalid parameter sequence of '" + err_param_seq +
"' for function: " + function_name_)); "' for function: " + function_name_));
return; return;
} }
@ -22932,7 +22952,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR115 - Type checker instantiation failure for generic function: " + function_name)); "ERR116 - Type checker instantiation failure for generic function: " + function_name));
return error_node(); return error_node();
} }
@ -22946,7 +22966,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR116 - Mismatch in zero parameter condition for generic function: " "ERR117 - Mismatch in zero parameter condition for generic function: "
+ function_name)); + function_name));
return error_node(); return error_node();
@ -22964,7 +22984,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR117 - Zero parameter call to generic function: " "ERR118 - Zero parameter call to generic function: "
+ function_name + " not allowed")); + function_name + " not allowed"));
return error_node(); return error_node();
@ -22995,7 +23015,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR118 - Expected ',' for call to generic function: " + function_name)); "ERR119 - Expected ',' for call to generic function: " + function_name));
return error_node(); return error_node();
} }
@ -23011,7 +23031,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR119 - Zero parameter call to generic function: " "ERR120 - Zero parameter call to generic function: "
+ function_name + " not allowed")); + function_name + " not allowed"));
return error_node(); return error_node();
@ -23027,7 +23047,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR120 - Expected ',' for call to generic function: " + function_name)); "ERR121 - Expected ',' for call to generic function: " + function_name));
return error_node(); return error_node();
} }
@ -23094,7 +23114,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR121 - Expected ',' for call to string function: " + function_name)); "ERR122 - Expected ',' for call to string function: " + function_name));
return error_node(); return error_node();
} }
@ -23109,7 +23129,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR122 - Expected ',' for call to string function: " + function_name)); "ERR123 - Expected ',' for call to string function: " + function_name));
return error_node(); return error_node();
} }
@ -23146,7 +23166,7 @@ namespace exprtk
p.set_error( p.set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
p.current_token(), p.current_token(),
"ERR123 - Expected '(' for special function")); "ERR124 - Expected '(' for special function"));
return error_node(); return error_node();
} }
@ -23166,7 +23186,7 @@ namespace exprtk
p.set_error( p.set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
p.current_token(), p.current_token(),
"ERR124 - Expected ',' before next parameter of special function")); "ERR125 - Expected ',' before next parameter of special function"));
return p.error_node(); return p.error_node();
} }
@ -23195,7 +23215,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_token, make_error(parser_error::e_token,
current_token(), current_token(),
"ERR125 - Invalid special function[1]: " + current_token().value)); "ERR126 - Invalid special function[1]: " + current_token().value));
return error_node(); return error_node();
} }
@ -23207,7 +23227,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_token, make_error(parser_error::e_token,
current_token(), current_token(),
"ERR126 - Invalid special function[2]: " + current_token().value)); "ERR127 - Invalid special function[2]: " + current_token().value));
return error_node(); return error_node();
} }
@ -23238,7 +23258,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR127 - Break call within a break call is not allowed")); "ERR128 - Break call within a break call is not allowed"));
return error_node(); return error_node();
} }
@ -23260,7 +23280,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR128 - Failed to parse return expression for 'break' statement")); "ERR129 - Failed to parse return expression for 'break' statement"));
return error_node(); return error_node();
} }
@ -23269,7 +23289,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR129 - Expected ']' at the completion of break's return expression")); "ERR130 - Expected ']' at the completion of break's return expression"));
free_node(node_allocator_,return_expr); free_node(node_allocator_,return_expr);
@ -23286,7 +23306,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR130 - Invalid use of 'break', allowed only in the scope of a loop")); "ERR131 - Invalid use of 'break', allowed only in the scope of a loop"));
} }
return error_node(); return error_node();
@ -23308,7 +23328,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR131 - Invalid use of 'continue', allowed only in the scope of a loop")); "ERR132 - Invalid use of 'continue', allowed only in the scope of a loop"));
return error_node(); return error_node();
} }
@ -23324,7 +23344,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR132 - Expected '[' as part of vector size definition")); "ERR133 - Expected '[' as part of vector size definition"));
return error_node(); return error_node();
} }
@ -23333,7 +23353,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR133 - Failed to determine size of vector '" + vec_name + "'")); "ERR134 - Failed to determine size of vector '" + vec_name + "'"));
return error_node(); return error_node();
} }
@ -23344,7 +23364,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR134 - Expected a literal number as size of vector '" + vec_name + "'")); "ERR135 - Expected a literal number as size of vector '" + vec_name + "'"));
return error_node(); return error_node();
} }
@ -23362,7 +23382,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR135 - Invalid vector size. Must be an integer greater than zero, size: " + "ERR136 - Invalid vector size. Must be an integer greater than zero, size: " +
details::to_str(details::numeric::to_int32(vector_size)))); details::to_str(details::numeric::to_int32(vector_size))));
return error_node(); return error_node();
@ -23381,7 +23401,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR136 - Expected ']' as part of vector size definition")); "ERR137 - Expected ']' as part of vector size definition"));
return error_node(); return error_node();
} }
@ -23392,7 +23412,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR137 - Expected ':=' as part of vector definition")); "ERR138 - Expected ':=' as part of vector definition"));
return error_node(); return error_node();
} }
@ -23405,7 +23425,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR138 - Failed to parse single vector initialiser")); "ERR139 - Failed to parse single vector initialiser"));
return error_node(); return error_node();
} }
@ -23417,7 +23437,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR139 - Expected ']' to close single value vector initialiser")); "ERR140 - Expected ']' to close single value vector initialiser"));
return error_node(); return error_node();
} }
@ -23463,7 +23483,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR140 - Expected '{' as part of vector initialiser list")); "ERR141 - Expected '{' as part of vector initialiser list"));
return error_node(); return error_node();
} }
@ -23482,7 +23502,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR141 - Expected '{' as part of vector initialiser list")); "ERR142 - Expected '{' as part of vector initialiser list"));
return error_node(); return error_node();
} }
@ -23499,7 +23519,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR142 - Expected ',' between vector initialisers")); "ERR143 - Expected ',' between vector initialisers"));
return error_node(); return error_node();
} }
@ -23520,7 +23540,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR143 - Expected ';' at end of vector definition")); "ERR144 - Expected ';' at end of vector definition"));
return error_node(); return error_node();
} }
@ -23531,7 +23551,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR144 - Initialiser list larger than the number of elements in the vector: '" + vec_name + "'")); "ERR145 - Initialiser list larger than the number of elements in the vector: '" + vec_name + "'"));
return error_node(); return error_node();
} }
@ -23550,7 +23570,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR145 - Illegal redefinition of local vector: '" + vec_name + "'")); "ERR146 - Illegal redefinition of local vector: '" + vec_name + "'"));
return error_node(); return error_node();
} }
@ -23583,7 +23603,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR146 - Failed to add new local vector '" + vec_name + "' to SEM")); "ERR147 - Failed to add new local vector '" + vec_name + "' to SEM"));
sem_.free_element(nse); sem_.free_element(nse);
@ -23637,7 +23657,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR147 - Illegal redefinition of local variable: '" + str_name + "'")); "ERR148 - Illegal redefinition of local variable: '" + str_name + "'"));
free_node(node_allocator_,initialisation_expression); free_node(node_allocator_,initialisation_expression);
@ -23668,7 +23688,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR148 - Failed to add new local string variable '" + str_name + "' to SEM")); "ERR149 - Failed to add new local string variable '" + str_name + "' to SEM"));
free_node(node_allocator_,initialisation_expression); free_node(node_allocator_,initialisation_expression);
@ -23713,7 +23733,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR149 - Illegal variable definition")); "ERR150 - Illegal variable definition"));
return error_node(); return error_node();
} }
@ -23733,7 +23753,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR150 - Expected a symbol for variable definition")); "ERR151 - Expected a symbol for variable definition"));
return error_node(); return error_node();
} }
@ -23742,7 +23762,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR151 - Illegal redefinition of reserved keyword: '" + var_name + "'")); "ERR152 - Illegal redefinition of reserved keyword: '" + var_name + "'"));
return error_node(); return error_node();
} }
@ -23751,7 +23771,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR152 - Illegal redefinition of variable '" + var_name + "'")); "ERR153 - Illegal redefinition of variable '" + var_name + "'"));
return error_node(); return error_node();
} }
@ -23760,7 +23780,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR153 - Illegal redefinition of local variable: '" + var_name + "'")); "ERR154 - Illegal redefinition of local variable: '" + var_name + "'"));
return error_node(); return error_node();
} }
@ -23779,7 +23799,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR154 - Failed to parse initialisation expression")); "ERR155 - Failed to parse initialisation expression"));
return error_node(); return error_node();
} }
@ -23796,7 +23816,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR155 - Expected ';' after variable definition")); "ERR156 - Expected ';' after variable definition"));
free_node(node_allocator_,initialisation_expression); free_node(node_allocator_,initialisation_expression);
@ -23823,7 +23843,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR156 - Illegal redefinition of local variable: '" + var_name + "'")); "ERR157 - Illegal redefinition of local variable: '" + var_name + "'"));
free_node(node_allocator_,initialisation_expression); free_node(node_allocator_,initialisation_expression);
@ -23854,7 +23874,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR157 - Failed to add new local variable '" + var_name + "' to SEM")); "ERR158 - Failed to add new local variable '" + var_name + "' to SEM"));
free_node(node_allocator_,initialisation_expression); free_node(node_allocator_,initialisation_expression);
@ -23890,7 +23910,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR158 - Expected a '{}' for uninitialised var definition")); "ERR159 - Expected a '{}' for uninitialised var definition"));
return error_node(); return error_node();
} }
@ -23899,7 +23919,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR159 - Expected ';' after uninitialised variable definition")); "ERR160 - Expected ';' after uninitialised variable definition"));
return error_node(); return error_node();
} }
@ -23915,7 +23935,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR160 - Illegal redefinition of local variable: '" + var_name + "'")); "ERR161 - Illegal redefinition of local variable: '" + var_name + "'"));
return error_node(); return error_node();
} }
@ -23944,7 +23964,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR161 - Failed to add new local variable '" + var_name + "' to SEM")); "ERR162 - Failed to add new local variable '" + var_name + "' to SEM"));
sem_.free_element(nse); sem_.free_element(nse);
@ -23976,7 +23996,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR162 - Expected '(' at start of swap statement")); "ERR163 - Expected '(' at start of swap statement"));
return error_node(); return error_node();
} }
@ -23994,7 +24014,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR163 - Expected a symbol for variable or vector element definition")); "ERR164 - Expected a symbol for variable or vector element definition"));
return error_node(); return error_node();
} }
@ -24005,7 +24025,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR164 - First parameter to swap is an invalid vector element: '" + var0_name + "'")); "ERR165 - First parameter to swap is an invalid vector element: '" + var0_name + "'"));
return error_node(); return error_node();
} }
@ -24037,7 +24057,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR165 - First parameter to swap is an invalid variable: '" + var0_name + "'")); "ERR166 - First parameter to swap is an invalid variable: '" + var0_name + "'"));
return error_node(); return error_node();
} }
@ -24050,7 +24070,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR166 - Expected ',' between parameters to swap")); "ERR167 - Expected ',' between parameters to swap"));
if (variable0_generated) if (variable0_generated)
{ {
@ -24067,7 +24087,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR167 - Expected a symbol for variable or vector element definition")); "ERR168 - Expected a symbol for variable or vector element definition"));
if (variable0_generated) if (variable0_generated)
{ {
@ -24083,7 +24103,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR168 - Second parameter to swap is an invalid vector element: '" + var1_name + "'")); "ERR169 - Second parameter to swap is an invalid vector element: '" + var1_name + "'"));
if (variable0_generated) if (variable0_generated)
{ {
@ -24120,7 +24140,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR169 - Second parameter to swap is an invalid variable: '" + var1_name + "'")); "ERR170 - Second parameter to swap is an invalid variable: '" + var1_name + "'"));
if (variable0_generated) if (variable0_generated)
{ {
@ -24138,7 +24158,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR170 - Expected ')' at end of swap statement")); "ERR171 - Expected ')' at end of swap statement"));
if (variable0_generated) if (variable0_generated)
{ {
@ -24192,7 +24212,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR171 - Return call within a return call is not allowed")); "ERR172 - Return call within a return call is not allowed"));
return error_node(); return error_node();
} }
@ -24215,7 +24235,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR172 - Expected '[' at start of return statement")); "ERR173 - Expected '[' at start of return statement"));
return error_node(); return error_node();
} }
@ -24237,7 +24257,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR173 - Expected ',' between values during call to return")); "ERR174 - Expected ',' between values during call to return"));
return error_node(); return error_node();
} }
@ -24248,7 +24268,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR174 - Zero parameter return statement not allowed")); "ERR175 - Zero parameter return statement not allowed"));
return error_node(); return error_node();
} }
@ -24262,7 +24282,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
prev_token, prev_token,
"ERR175 - Invalid ']' found during return call")); "ERR176 - Invalid ']' found during return call"));
return error_node(); return error_node();
} }
@ -24314,7 +24334,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR176 - Invalid sequence of variable '"+ symbol + "' and bracket")); "ERR177 - Invalid sequence of variable '"+ symbol + "' and bracket"));
return false; return false;
} }
@ -24361,7 +24381,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR177 - Invalid sequence of brackets")); "ERR178 - Invalid sequence of brackets"));
return false; return false;
} }
@ -24457,7 +24477,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR178 - Failed to generate node for function: '" + symbol + "'")); "ERR179 - Failed to generate node for function: '" + symbol + "'"));
return error_node(); return error_node();
} }
@ -24482,7 +24502,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR179 - Failed to generate node for vararg function: '" + symbol + "'")); "ERR180 - Failed to generate node for vararg function: '" + symbol + "'"));
return error_node(); return error_node();
} }
@ -24507,7 +24527,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR180 - Failed to generate node for generic function: '" + symbol + "'")); "ERR181 - Failed to generate node for generic function: '" + symbol + "'"));
return error_node(); return error_node();
} }
@ -24533,7 +24553,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR181 - Failed to generate node for string function: '" + symbol + "'")); "ERR182 - Failed to generate node for string function: '" + symbol + "'"));
return error_node(); return error_node();
} }
@ -24555,7 +24575,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR182 - Invalid use of reserved symbol '" + symbol + "'")); "ERR183 - Invalid use of reserved symbol '" + symbol + "'"));
return error_node(); return error_node();
} }
@ -24615,7 +24635,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_symtab, make_error(parser_error::e_symtab,
current_token(), current_token(),
"ERR183 - Failed to create variable: '" + symbol + "'" + "ERR184 - Failed to create variable: '" + symbol + "'" +
(error_message.empty() ? "" : " - " + error_message))); (error_message.empty() ? "" : " - " + error_message)));
} }
@ -24641,7 +24661,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_symtab, make_error(parser_error::e_symtab,
current_token(), current_token(),
"ERR184 - Failed to resolve symbol: '" + symbol + "'" + "ERR185 - Failed to resolve symbol: '" + symbol + "'" +
(error_message.empty() ? "" : " - " + error_message))); (error_message.empty() ? "" : " - " + error_message)));
} }
@ -24652,7 +24672,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR185 - Undefined symbol: '" + symbol + "'")); "ERR186 - Undefined symbol: '" + symbol + "'"));
return error_node(); return error_node();
} }
@ -24758,7 +24778,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_symtab, make_error(parser_error::e_symtab,
current_token(), current_token(),
"ERR186 - Variable or function detected, yet symbol-table is invalid, Symbol: " + current_token().value)); "ERR187 - Variable or function detected, yet symbol-table is invalid, Symbol: " + current_token().value));
return error_node(); return error_node();
} }
@ -24783,7 +24803,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_numeric, make_error(parser_error::e_numeric,
current_token(), current_token(),
"ERR187 - Failed to convert '" + current_token().value + "' to a number")); "ERR188 - Failed to convert '" + current_token().value + "' to a number"));
return error_node(); return error_node();
} }
@ -24809,7 +24829,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR188 - Expected ')' instead of: '" + current_token().value + "'")); "ERR189 - Expected ')' instead of: '" + current_token().value + "'"));
free_node(node_allocator_,branch); free_node(node_allocator_,branch);
@ -24833,7 +24853,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR189 - Expected ']' instead of: '" + current_token().value + "'")); "ERR190 - Expected ']' instead of: '" + current_token().value + "'"));
free_node(node_allocator_,branch); free_node(node_allocator_,branch);
@ -24857,7 +24877,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR190 - Expected '}' instead of: '" + current_token().value + "'")); "ERR191 - Expected '}' instead of: '" + current_token().value + "'"));
free_node(node_allocator_,branch); free_node(node_allocator_,branch);
@ -24896,7 +24916,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR191 - Premature end of expression[1]")); "ERR192 - Premature end of expression[1]"));
return error_node(); return error_node();
} }
@ -24905,7 +24925,7 @@ namespace exprtk
set_error( set_error(
make_error(parser_error::e_syntax, make_error(parser_error::e_syntax,
current_token(), current_token(),
"ERR192 - Premature end of expression[2]")); "ERR193 - Premature end of expression[2]"));
return error_node(); return error_node();
} }