zxul767 / lox

An interpreter for the Lox language
1 stars 0 forks source link

`jlox` REPL should not automatically expand `!expr` on `ENTER` #23

Open zxul767 opened 1 year ago

zxul767 commented 1 year ago

i believe there's some misconfiguration in the REPL's "readline" library that causes the following odd behavior:

>>> "hi" < "hello"
Runtime Error: Operands must be numbers
[line 1]
>>> !"hi"
>>> "hi" < "hello"
Runtime Error: Operands must be numbers
[line 1]

notice how upon pressing ENTER the !"hi" expression gets automatically expanded to the last command/expression instead of being evaluated normally.

the same issue is present when pressing TAB, although in this case the behavior is just fine, as TAB is often used for autocompletion commands in many apps.