An interpreter for Lox. Written in Kotlin.
Currently in progress of being rewritten for Graal/Truffle.
- C-style multiline comments (/* ... */) implemented; can be nested
- C-style ternary operator implemented
- Strings can be concatenated with anything
- Division by 0 causes a RuntimeError instead of NaN
- Variables are not initialized to nil by default; access before initialization leads to a RuntimeError
- Maximum function arguments are 16 instead of 8
- 'print $obj' statement is replaced by print($obj) and printLine($obj) native functions
- More native functions, see Interpreter class for a list of them
# Run as REPL
./gradlew run
# Execute $file
./gradlew run $file
Follow the style used by the default code formatter in IntelliJ IDEA. Max line length is 150.