kill me please
This commit is contained in:
parent
16f1174e7d
commit
c910178efd
2 changed files with 3 additions and 2 deletions
|
|
@ -180,7 +180,7 @@ private:
|
|||
}
|
||||
else if (auto *str = dynamic_cast<const String *>(&expr))
|
||||
{
|
||||
write("\"" + str->value + "\"");
|
||||
write(str->value);
|
||||
}
|
||||
else if (auto *binop = dynamic_cast<const BinOp *>(&expr))
|
||||
{
|
||||
|
|
@ -202,7 +202,7 @@ private:
|
|||
}
|
||||
else if (auto *unary_op = dynamic_cast<const UnaryOpExpr *>(&expr))
|
||||
{
|
||||
output << unary_op->op.symbol();
|
||||
output << unary_op->op.symbol() << " ";
|
||||
generate_expr(*unary_op->operand);
|
||||
}
|
||||
else if (auto *attr = dynamic_cast<const Attribute *>(&expr))
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ expr:
|
|||
| expr LT expr { $$ = std::make_unique<BinOp>( BinaryOperator(BinaryOperator::LT) , std::move($1), std::move($3)); }
|
||||
| expr KW_AND expr { $$ = std::make_unique<BinOp>( BinaryOperator(BinaryOperator::AND) , std::move($1), std::move($3)); }
|
||||
| expr KW_OR expr { $$ = std::make_unique<BinOp>( BinaryOperator(BinaryOperator::OR) , std::move($1), std::move($3)); }
|
||||
| KW_NOT expr { $$ = std::make_unique<UnaryOpExpr>( UnaryOperator(UnaryOperator::NOT) , std::move($2)); }
|
||||
| expr L_BRACKET expr R_BRACKET { $$ = std::make_unique<Subscript>(std::move($1), std::move($3));}
|
||||
| expr L_BRACKET slice R_BRACKET{ $$ = std::make_unique<SliceSubscript>(std::move($1), std::move($3)); }
|
||||
| L_PAREN expr R_PAREN {$$ = std::move($2); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue