add loop keyword
This commit is contained in:
parent
1ab966b853
commit
460055e186
3 changed files with 8 additions and 0 deletions
|
@ -6,6 +6,11 @@ a vlang parser in zig
|
||||||
|
|
||||||
because i can
|
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
|
## how
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -50,6 +50,7 @@ const keywords = [_][]const u8{
|
||||||
"false",
|
"false",
|
||||||
"None",
|
"None",
|
||||||
"println",
|
"println",
|
||||||
|
"loop",
|
||||||
};
|
};
|
||||||
|
|
||||||
const keyword_ttypes = [_]TokenType{
|
const keyword_ttypes = [_]TokenType{
|
||||||
|
@ -78,6 +79,7 @@ const keyword_ttypes = [_]TokenType{
|
||||||
.False,
|
.False,
|
||||||
.None,
|
.None,
|
||||||
.Println,
|
.Println,
|
||||||
|
.Loop,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn getKeyword(keyword: []const u8) ?TokenType {
|
fn getKeyword(keyword: []const u8) ?TokenType {
|
||||||
|
|
|
@ -55,6 +55,7 @@ pub const TokenType = enum {
|
||||||
Enum,
|
Enum,
|
||||||
Fn,
|
Fn,
|
||||||
For,
|
For,
|
||||||
|
Loop,
|
||||||
Go,
|
Go,
|
||||||
Goto,
|
Goto,
|
||||||
If,
|
If,
|
||||||
|
|
Loading…
Reference in a new issue