diff --git a/__pycache__/build.cpython-39.pyc b/__pycache__/build.cpython-39.pyc new file mode 100644 index 0000000..056976e Binary files /dev/null and b/__pycache__/build.cpython-39.pyc differ diff --git a/src/compiler.nim b/src/compiler.nim index 20727fc..9164147 100644 --- a/src/compiler.nim +++ b/src/compiler.nim @@ -310,6 +310,11 @@ proc binary(self: Compiler, canAssign: bool) = of TokenType.DEQ: self.emitByte(OpCode.Equal) of TokenType.GT: + # To allow for chaining of greater/less comparisons in the future (without doing + # weird stuff such as allowing false with the greater/less than operators) + # we need to move their logic in another function. This will + # also allow for a sort of short-circuiting control flow like + # for logical ands and ors, because why not? self.emitByte(OpCode.Greater) of TokenType.GE: self.emitByte(OpCode.GreaterOrEqual) diff --git a/src/japl.nim b/src/japl.nim index 0f6c846..0e17c00 100644 --- a/src/japl.nim +++ b/src/japl.nim @@ -31,12 +31,14 @@ import jale/plugin/defaults import jale/plugin/history import jale/plugin/editor_history + proc getLineEditor: LineEditor = result = newLineEditor() result.prompt = "=> " - result.populateDefaults() # setup default keybindings - let hist = result.plugHistory() # create history object - result.bindHistory(hist) # set default history keybindings + result.populateDefaults() # setup default keybindings + let hist = result.plugHistory() # create history object + result.bindHistory(hist) # set default history keybindings + proc repl(bytecodeVM: VM) = var bytecodeVM = bytecodeVM @@ -58,8 +60,6 @@ proc repl(bytecodeVM: VM) = continue elif source == "//exit" or source == "// exit": echo "Goodbye!" - echo JAPL_VERSION_STRING - echo nimDetails break elif source != "": discard bytecodeVM.interpret(source, "stdin")