Introduce the requirement of let for assignment.

This commit is contained in:
alex committed 2023-09-04 02:33:13 -07:00
1 parent 128f40bcf4
commit 3545aa076f
10 files changed
+40 -28

No files matched your search

@@ -17,7 +17,7 @@ class EvaluationVisitor(root: Scope) : NodeVisitor<Any> {
return currentScope.call(node.symbol.id, Arguments(arguments))
}
override fun visitDefine(node: Assignment): Any {
override fun visitLetAssignment(node: LetAssignment): Any {
val value = visit(node.value)
currentScope.define(node.symbol.id, value)
return value