Skip to content

uberballo/lox

Repository files navigation

Lox

Interpreter wrote with the guidance of Crafting interpreter. One of the new projects.

How to use

Have Rust installed.

Start the repl with:

    cargo run

With a file pass the path as the argument:

    cargo run test1.lox

List of tests

  • test1.lox Assign values to variables and handle scopes.
  • test2.lox Handle if-cases.
  • test3.lox For-loops.
  • test4.lox While-loops.
  • test5.lox Functions.
  • test6.lox Fibonacci (My favorite).
  • test7.lox Assigning functions to variables.

TODO

There are still few chapters to be done and some TODO's here and there.

  • Improve Interpreter.rs error handling. Currently it's quite bad.
  • Code generation.
  • Tests.
  • Fix errors that come from the .lox files.

Chapters

  • Scanning
  • Representing Code.
  • Parsing Expressions
  • Evaluating Expressions
  • Statements and State
  • Control flow
  • Functions
  • Resolving and binding

About

Lox language interpreter, but with Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages