An open API service indexing awesome lists of open source software.

https://github.com/rami3l/dolores

A tree-walking interpreter for the Lox Programming Language.
https://github.com/rami3l/dolores

crafting-interpreters interpreter lox lox-language programming-language rust rust-lang

Last synced: 5 months ago
JSON representation

A tree-walking interpreter for the Lox Programming Language.

Awesome Lists containing this project

README

          

# dolores

> "... light of my life."

[The Lox Programming Language](https://www.craftinginterpreters.com/the-lox-language.html) implemented in Rust.

Ported from the original Java-based `jlox` tree-walking interpreter\*, but with no visitor patterns, no `null` values, no subclasses and implicit conversions, just pure `enum`s.

~~`Gc` is a necessary evil...~~

\* : For the bytecode VM interpreter, see [`rami3l/golox`](https://github.com/rami3l/golox).

---

## Contents

- [dolores](#dolores)
- [Contents](#contents)
- [Features](#features)
- [Try it out!](#try-it-out)

---

## Features

- [x] Lexer
- [x] Parser
- [x] Basic types
- [x] Floating point arithmetic
- [x] Logic expressions
- [x] Control flow
- [x] Jumps: `break`/`continue`\*\*
- [x] Semantic analysis: jumping out of loops
- [x] Functions
- [x] Lambdas\*\*
- [x] Semantic analysis: returning out of functions
- [x] Semantic analysis: static closure captures
- [x] Classes
- [x] Instances
- [x] Instance methods
- [x] `this`
- [x] Semantic analysis: `this` out of classes
- [x] Initializers
- [x] Semantic analysis: `return`ing values in initializers
- [x] Inheritance
- [x] `super`
- [x] Semantic analysis: `super` out of subclasses

\*\* : Extension

## Try it out!

With the latest [Rust toolchain](https://www.rust-lang.org/tools/install) installed, just execute:

```bash
cargo run
```