add loop keyword

This commit is contained in:
Luna 2019-08-25 16:49:08 -03:00
parent 1ab966b853
commit 460055e186
3 changed files with 8 additions and 0 deletions

View file

@ -6,6 +6,11 @@ a vlang parser in zig
because i can
## variations
- `for` is split between `for` and `loop` because my fucking god i cant stand
having *four* different variations of `for`.
## how
```

View file

@ -50,6 +50,7 @@ const keywords = [_][]const u8{
"false",
"None",
"println",
"loop",
};
const keyword_ttypes = [_]TokenType{
@ -78,6 +79,7 @@ const keyword_ttypes = [_]TokenType{
.False,
.None,
.Println,
.Loop,
};
fn getKeyword(keyword: []const u8) ?TokenType {

View file

@ -55,6 +55,7 @@ pub const TokenType = enum {
Enum,
Fn,
For,
Loop,
Go,
Goto,
If,