C++20 implementation of the bytecode VM from Crafting Interpreters.
make
./loxc <file>By default it builds a debug version; use make BUILD=release to disable that.
This is needed to make clang-based tools (like clangd) work properly:
brew install bear
make clean
bear -- make testNote that building the test target also builds the main programme (so this ensures that compile_commands.json will contain entries for both the main programme and the tests).
brew install pkg-config catch2
make testI allow
{
var a = 1;
{
var a = a;
}
}
The initialiser on the right hand side refers to the outer a, not itself. Original Lox throws an error in this case.