diff options
| author | Cody <cody@codyq.dev> | 2022-12-15 14:18:13 -0600 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2022-12-15 14:18:13 -0600 |
| commit | 900bd3d64ac4c5c4c1511ab8388da3f2ed77849f (patch) | |
| tree | 8de3006843d9dc717bf1c00d9942a068c90f413c /src/lexer.rs | |
| parent | bddb011df4999f7ffeeddf6a4b66e2da6ab19ea0 (diff) | |
| download | sloth-900bd3d64ac4c5c4c1511ab8388da3f2ed77849f.tar.gz | |
Replace `let` keyword with `val` and `var`
Thanks for pointing out that using `let` and `let mut` was stupid for a
scripting language @mworzala
Diffstat (limited to 'src/lexer.rs')
| -rw-r--r-- | src/lexer.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lexer.rs b/src/lexer.rs index 602b5e1..e850cb0 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -49,7 +49,8 @@ pub enum TokenType { Identifier(String), // Keywords - Let, + Val, + Var, Fn, If, @@ -245,7 +246,8 @@ impl<'a> Iterator for Lexer<'a> { } match value.as_str() { - "let" => TokenType::Let, + "val" => TokenType::Val, + "var" => TokenType::Var, "fn" => TokenType::Fn, "if" => TokenType::If, "else" => TokenType::Else, |
