chharvey / counterpoint

A robust programming language.
GNU Affero General Public License v3.0
2 stars 0 forks source link

Parse Variable Declaration and Reassignment Statements #13

Closed chharvey closed 4 years ago

chharvey commented 4 years ago

Parse variable declaration and reassignment statements, for (re)assigning expressions to variables. Update the final goal symbol to include multiple statements.

Goal ::= #x02 Statement* #x03

Statement ::=
    DeclarationVariable |
    StatementAssignment |
    Expression ";"

DeclarationVariable ::= "let" "unfixed"? IDENTIFIER "=" Expression ";"

StatementAssignment ::= IDENTIFIER "=" Expression ";"
chharvey commented 4 years ago

updating this issue to include empty statements.

Statement ::=
    DeclarationVariable |
    StatementAssignment |
    Expression? ";"