std::unique_ptr<Expression> PostfixOperatorParser::parse(ElsaParser* parser, std::unique_ptr<Expression> left) { auto exp = std::make_unique<PostfixOperatorExpression>(); exp->set_expression(std::move(left)); exp->set_operator(parser->current_token()->get_type()); // Consume the operator token parser->consume(); exp->set_type(parser->type_checker().get_expression_type(exp->get_expression())); if(parser->current_token()->get_type() == TokenType::Semicolon) parser->consume(TokenType::Semicolon); return std::move(exp); }
void CharLook::reset() { flip = true; action = nullptr; actionstr = ""; actframe = 0; set_stance(Stance::STAND1); stframe.set(0); stelapsed = 0; set_expression(Expression::DEFAULT); expframe.set(0); expelapsed = 0; }
t_arexp_condition *arexp_condition_new_from_tokens(t_lst *tokens) { t_arexp *singleton; t_arexp_condition *condition; singleton = arexp_singleton(NULL, false); if (singleton->depth > AREXP_MAX_DEPTH) { singleton->error_msg = twl_strdup("maximum depth reached"); return (0); } if (!(condition = get_condition(tokens, singleton))) return (NULL); condition = set_expression(condition, tokens, singleton); if (!condition || !condition->expression_if) return (condition); if (!(condition->condition_else = get_condition_new(tokens, singleton))) { arexp_condition_del(condition); return (NULL); } return (condition); }