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 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
``` ```

View File

@ -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 {

View File

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