parser add assigment statement

This commit is contained in:
Marvin Schlegel 2024-05-16 11:15:41 +02:00
parent b11adcf907
commit f81a812f59

View File

@ -215,7 +215,7 @@ localvariabledeclaration : type variabledeclarators { map LocalVariableDeclarati
statementwithouttrailingsubstatement : block { [$1] }
| emptystatement { [] }
-- | expressionstatement { }
| expressionstatement { [$1] }
| returnstatement { [$1] }
ifthenstatement : IF LBRACE expression RBRACE statement { If $3 (Block $5) Nothing }
@ -229,7 +229,7 @@ assignmentexpression : conditionalexpression { $1 }
emptystatement : SEMICOLON { Block [] }
expressionstatement : statementexpression SEMICOLON { }
expressionstatement : statementexpression SEMICOLON { StatementExpressionStatement $1 }
returnstatement : RETURN SEMICOLON { Return Nothing }
| RETURN expression SEMICOLON { Return $ Just $2 }
@ -248,13 +248,13 @@ assignment : lefthandside assignmentoperator assignmentexpression {
}
statementexpression : assignment { }
| preincrementexpression { }
| predecrementexpression { }
| postincrementexpression { }
| postdecrementexpression { }
| methodinvocation { }
| classinstancecreationexpression { }
statementexpression : assignment { $1 }
-- | preincrementexpression { }
-- | predecrementexpression { }
-- | postincrementexpression { }
-- | postdecrementexpression { }
-- | methodinvocation { }
-- | classinstancecreationexpression { }
ifthenelsestatementnoshortif :IF LBRACE expression RBRACE statementnoshortif
ELSE statementnoshortif { }