Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rapiz1 committed Oct 30, 2021
1 parent 1421474 commit 75339b4
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
# clox

Lox Interpreter in C++ (under development)
Lox(well, not really) Interpreter in C++ (under development)

## Background
This is a learning project for [Crafting interpreters](https://craftinginterpreters.com/).

I'm not actully implementing the authentic Lox. I adopted it according to my likes.

Lox is a language that is very similar to C, but with dynamic types. Let's see an example.

```
// calculate the greatest common divisor
function gcd(a, b) {
if (b == 0) return a;
while (a >= b) a = a - b;
return gcd(b, a);
}
print gcd(99, 121);
assert gcd(99, 121) == 11;
```

## Roadmap

- [x] basic lexer
- [x] basic parser
- [x] ``+,-,*,/,=,==,!=,<,>,<=,>=,(,)``
- [ ] ``+=, -=, *=, /=``
- [x] support ++, --. but no `----a` bullshit! theses ops return rvalue
- [x] print statement
- [x] expr statement
- [x] var declartion
- [x] block scoping
- [x] for, while block
- [x] branch
- [x] assert statement
- [x] **testing the language with itself (built-in assert)!** see `./tests`
- [ ] no continue! i'm lazy
- [x] break
- [x] function
Expand Down

0 comments on commit 75339b4

Please sign in to comment.