added block expression

This commit is contained in:
Andrew Segavac
2021-05-29 11:01:34 -06:00
parent 374e080f26
commit 03fb361e0b
3 changed files with 9 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ class VariableUsage:
@dataclass
class Expression:
expression: Union[LiteralInt, LiteralFloat, FunctionCall, VariableUsage, Operation]
expression: Union[LiteralInt, LiteralFloat, FunctionCall, "Block", VariableUsage, Operation]
type: TypeUsage
@@ -163,6 +163,7 @@ boring_grammar = r"""
| variable_usage
| function_call
| "(" expression ")"
| block
let_statement : "let" identifier "=" expression ";"
| "let" identifier ":" type_usage "=" expression ";"