Skip to content
/ tslox Public

An Interpreter for the Lox programming language in TypeScript using the Deno runtime

License

Notifications You must be signed in to change notification settings

rnsloan/tslox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lox Interpreter

A Tree-Walking Interpreter for the Lox programming language in TypeScript http://craftinginterpreters.com/appendix-i.html

Run

Executables

Check the Repository releases page https://github.com/rnsloan/tslox/releases for executables. Example usage:

./tslox.silicon ./code.lox

Manually

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.

Development

Deno version 1.23 or later is required.

Run deno task compile to output the executables.

Specification

The Abstract Syntax Tree format adheres to the Acorn / ESTree Specification with one extension. A PrintStatement node:

interface PrintStatement {
  type: "PrintStatement";
  argument: Expression;
}

Test

  • deno task test
  • deno task update-snapshots

About

An Interpreter for the Lox programming language in TypeScript using the Deno runtime

Topics

Resources

License

Stars

Watchers

Forks