return true;
}
-static bool parser_sy_pop(parser_t *parser, shunt *sy)
+static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
{
const oper_info *op;
lex_ctx ctx;
/* pop off the parenthesis */
vec_shrinkby(sy->ops, 1);
/* then apply the index operator */
- if (!parser_sy_pop(parser, sy))
+ if (!parser_sy_apply_operator(parser, sy))
return false;
return true;
}
vec_shrinkby(sy->ops, 1);
return true;
}
- if (!parser_sy_pop(parser, sy))
+ if (!parser_sy_apply_operator(parser, sy))
return false;
}
return true;
(op->prec < olast->prec) ||
(op->assoc == ASSOC_LEFT && op->prec <= olast->prec) ) )
{
- if (!parser_sy_pop(parser, &sy))
+ if (!parser_sy_apply_operator(parser, &sy))
goto onerr;
if (vec_size(sy.ops) && !vec_last(sy.ops).paren)
olast = &operators[vec_last(sy.ops).etype-1];
}
while (vec_size(sy.ops)) {
- if (!parser_sy_pop(parser, &sy))
+ if (!parser_sy_apply_operator(parser, &sy))
goto onerr;
}
vec_push(sy.out, syexp(ast_ctx(var), (ast_expression*)var));
vec_push(sy.out, syexp(ast_ctx(cexp), (ast_expression*)cexp));
vec_push(sy.ops, syop(ast_ctx(var), parser->assign_op));
- if (!parser_sy_pop(parser, &sy))
+ if (!parser_sy_apply_operator(parser, &sy))
ast_unref(cexp);
else {
if (vec_size(sy.out) != 1 && vec_size(sy.ops) != 0)