No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
.vscode
frontend
interpreter
opcode
syntax
tests
tox
util
vm
.DS_Store
.gitignore
.travis.yml
Cargo.lock
Cargo.toml
LICENSE
README.md
test.py

README.md

Grammar

Build Status

TOX

Tox is a statically typed version of lox that is written in rust.

Usage

USAGE:
    tox [FLAGS] [source]

FLAGS:
    -h, --help         Prints help information
    -i, --interpter    Run in interpreter mode
    -V, --version      Prints version information

ARGS:
    <source>    The source code file

Example Program

fn fib(n:int) -> int {
    if (n < 2) 
      return n;
    return fib(n - 2) + fib(n - 1);
}

A simple example that makes of uses of the classes

class Toggle {
    state:bool;
  
    fn value() -> bool {
      return this.state;
    }
  
    fn activate() -> Toggle {
      this.state = !this.state;
      return this;
    }
}
  
fn main() {
  var toggle  = Toggle{state:true};

  print toggle.activate().value();

  print toggle.activate().value();
}

TODO

[] Implement nested for while loops [x] Improve documentation [x] Fix variable scopes

Resources