allow variables starting with $ and @

This commit is contained in:
pantor committed 2021-01-16 16:40:03 +01:00
1 parent 316567898e
commit a3b0b41d48
4 files changed
+14

No files matched your search

+6
View File
@@ -2049,6 +2049,8 @@ class Lexer {
minus_state = MinusState::Operator;
return scan_number();
case '_':
case '@':
case '$':
minus_state = MinusState::Operator;
return scan_id();
default:
@@ -3435,6 +3437,10 @@ class Renderer : public NodeVisitor {
template<bool throw_not_found=true>
Arguments get_argument_vector(size_t N, const AstNode& node) {
if (json_eval_stack.size() < N) {
throw_renderer_error("function needs " + std::to_string(N) + " variables, but has only found " + std::to_string(json_eval_stack.size()), node);
}
Arguments result {N};
for (size_t i = 0; i < N; i += 1) {
result[N - i - 1] = json_eval_stack.top();