about summary refs log tree commit diff
path: root/src/lex
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2021-10-23 22:01:52 +0200
committerMel <einebeere@gmail.com>2021-10-23 22:01:52 +0200
commit8a6eb35a900081967db16d313ab7ed470de6570f (patch)
treed58dd702d8a742c7554545bc4e291480649e3663 /src/lex
parentda14afd74e1659af6ce4553360ac5dd0ce933db8 (diff)
downloadrabbithole-8a6eb35a900081967db16d313ab7ed470de6570f.tar.zst
rabbithole-8a6eb35a900081967db16d313ab7ed470de6570f.zip
Loop expressions and concrete walker errors.
Diffstat (limited to 'src/lex')
-rw-r--r--src/lex/lexer.rs3
-rw-r--r--src/lex/mod.rs2
-rw-r--r--src/lex/token.rs3
3 files changed, 7 insertions, 1 deletions
diff --git a/src/lex/lexer.rs b/src/lex/lexer.rs
index 4d980d6..60301c3 100644
--- a/src/lex/lexer.rs
+++ b/src/lex/lexer.rs
@@ -190,12 +190,15 @@ impl<'s> Lexer<'s> {
             "if" => TokenVariant::KeywordIf,
             "elif" => TokenVariant::KeywordElif,
             "else" => TokenVariant::KeywordElse,
+            "loop" => TokenVariant::KeywordLoop,
             "type" => TokenVariant::KeywordType,
             "form" => TokenVariant::KeywordForm,
             "self" => TokenVariant::KeywordSelf,
             "true" => TokenVariant::KeywordTrue,
             "false" => TokenVariant::KeywordFalse,
             "return" => TokenVariant::KeywordReturn,
+            "break" => TokenVariant::KeywordBreak,
+            "continue" => TokenVariant::KeywordContinue,
             "print" => TokenVariant::KeywordPrint,
             _ => TokenVariant::Ident(buffer),
         };
diff --git a/src/lex/mod.rs b/src/lex/mod.rs
index f785280..e12719b 100644
--- a/src/lex/mod.rs
+++ b/src/lex/mod.rs
@@ -1,2 +1,2 @@
 pub mod lexer;
-pub mod token;
\ No newline at end of file
+pub mod token;
diff --git a/src/lex/token.rs b/src/lex/token.rs
index 5debbfd..2fb5d5b 100644
--- a/src/lex/token.rs
+++ b/src/lex/token.rs
@@ -53,11 +53,14 @@ pub enum TokenVariant {
     KeywordIf,
     KeywordElif,
     KeywordElse,
+    KeywordLoop,
     KeywordForm,
     KeywordType,
     KeywordTrue,
     KeywordFalse,
     KeywordSelf,
+    KeywordBreak,
+    KeywordContinue,
     KeywordReturn,
     KeywordPrint,