mirror of https://github.com/japl-lang/japl.git
Added a comment for a future implementation of greater/less than comparisons and reverted old behavior
This commit is contained in:
parent
a4ef124d3f
commit
d82e8ed2b0
Binary file not shown.
|
@ -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)
|
||||
|
|
10
src/japl.nim
10
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")
|
||||
|
|
Loading…
Reference in New Issue