feat: implement expression evaluation and statement detection in REPL with Meta.compileExpression
Add executeInput() method to REPL that lexes input, determines if it's a statement or expression based on the first token, and evaluates accordingly using Meta.eval for statements or the new Meta.compileExpression for expressions. Extend Meta.compile_ foreign method with isExpression and printErrors parameters, update wrenCompile signature to support expression compilation mode, and add newline handling after equals in variable definitions.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
var foo =
|
||||
|
||||
|
||||
123
|
||||
System.print(foo) // expect: 123
|
||||
Reference in New Issue
Block a user