correction bug Op

This commit is contained in:
trochas
2025-04-01 18:17:52 +02:00
parent 3f9072c7bd
commit bef2073599
4 changed files with 11 additions and 11 deletions

View File

@@ -67,8 +67,8 @@ expression [SymTable table] returns [Type return_Type, Expression out]:
(op=(PLUS | MINUS) right=td_expression[table] {
$out = new BinopExpression(
switch($op.getType()) {
case PLUS -> PLUS;
case MINUS -> MINUS;
case PLUS -> Op.PLUS;
case MINUS -> Op.MINUS;
default -> throw new IllegalArgumentException("Unknown operator");
},
$left.out,
@@ -86,8 +86,8 @@ td_expression [SymTable table] returns [Type return_Type, Expression out]:
(op=(TIMES | DIV) right=lit {
$out = new Program.BinopExpression(
switch($op.getType()) {
case TIMES -> TIMES;
case DIV -> DIV;
case TIMES -> Op.TIMES;
case DIV -> Op.DIV;
default -> throw new IllegalArgumentException("Unknown operator");
},
$left.out,