diff --git a/src/module/repl.wren b/src/module/repl.wren index 6a471458..6a77478e 100644 --- a/src/module/repl.wren +++ b/src/module/repl.wren @@ -11,11 +11,6 @@ class Repl { _history = [] _historyIndex = 0 - - // Whether or not we allow ASCI escape sequences for showing colors and - // moving the cursor. When this is false, the REPL has reduced - // functionality. - _allowAnsi = false } cursor { _cursor } @@ -172,15 +167,17 @@ class Repl { token.type == Token.varKeyword || token.type == Token.whileKeyword - var fiber + var closure if (isStatement) { - fiber = Meta.compile(input) + closure = Meta.compile(input) } else { - fiber = Meta.compileExpression(input) + closure = Meta.compileExpression(input) } // Stop if there was a compile error. - if (fiber == null) return + if (closure == null) return + + var fiber = Fiber.new(closure) var result = fiber.try() if (fiber.error != null) { diff --git a/src/module/repl.wren.inc b/src/module/repl.wren.inc index 196fbcf3..dcd923da 100644 --- a/src/module/repl.wren.inc +++ b/src/module/repl.wren.inc @@ -13,11 +13,6 @@ static const char* replModuleSource = "\n" " _history = []\n" " _historyIndex = 0\n" -"\n" -" // Whether or not we allow ASCI escape sequences for showing colors and\n" -" // moving the cursor. When this is false, the REPL has reduced\n" -" // functionality.\n" -" _allowAnsi = false\n" " }\n" "\n" " cursor { _cursor }\n" @@ -174,15 +169,17 @@ static const char* replModuleSource = " token.type == Token.varKeyword ||\n" " token.type == Token.whileKeyword\n" "\n" -" var fiber\n" +" var closure\n" " if (isStatement) {\n" -" fiber = Meta.compile(input)\n" +" closure = Meta.compile(input)\n" " } else {\n" -" fiber = Meta.compileExpression(input)\n" +" closure = Meta.compileExpression(input)\n" " }\n" "\n" " // Stop if there was a compile error.\n" -" if (fiber == null) return\n" +" if (closure == null) return\n" +"\n" +" var fiber = Fiber.new(closure)\n" "\n" " var result = fiber.try()\n" " if (fiber.error != null) {\n"