A Tree-Walking Interpreter for the Lox programming language in TypeScript http://craftinginterpreters.com/appendix-i.html
Check the Repository releases page https://github.com/rnsloan/tslox/releases for executables. Example usage:
./tslox.silicon ./code.lox
Clone the repository. Deno version 1.23
or later is required.
Create code.lox
at the root of the project. See the code.sample.lox
file.
fun helloWorld() {
var hello = "hello world!";
print hello;
}
helloWorld();
run deno task exec
for the project root.
Deno version 1.23
or later is required.
- run
deno task debug
to see output at each stage - Deno debugger guide: https://deno.land/manual/getting_started/debugging_your_code
Run deno task compile
to output the executables.
The Abstract Syntax Tree format adheres to the Acorn / ESTree Specification with one extension. A PrintStatement
node:
interface PrintStatement {
type: "PrintStatement";
argument: Expression;
}
deno task test
deno task update-snapshots