added strings

This commit is contained in:
bronku 2025-11-27 15:46:31 +01:00
parent c76b84682a
commit 922213d9c6

View file

@ -75,6 +75,7 @@ stmt:
expr: expr:
NUMBER { $$ = std::make_unique<Number>($1); } NUMBER { $$ = std::make_unique<Number>($1); }
| IDENTIFIER { $$ = std::make_unique<Identifier>($1); } | IDENTIFIER { $$ = std::make_unique<Identifier>($1); }
| STRING { $$ = std::make_unique<String>($1); }
| expr PLUS expr { $$ = std::make_unique<BinOp>( | expr PLUS expr { $$ = std::make_unique<BinOp>(
BinaryOperator(BinaryOperator::ADD), BinaryOperator(BinaryOperator::ADD),
std::move($1), std::move($3)); } std::move($1), std::move($3)); }