aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lexer.rs96
1 files changed, 84 insertions, 12 deletions
diff --git a/src/lexer.rs b/src/lexer.rs
index ef79716..8631eef 100644
--- a/src/lexer.rs
+++ b/src/lexer.rs
@@ -14,18 +14,82 @@ pub enum TokenType {
DocComment,
Comment,
- // Operatiors
- Plus,
- Minus,
- Star,
- Slash,
- Perc,
-
- PlusEq,
- MinusEq,
- StarEq,
- SlashEq,
- PercEq,
+ // Brackets
+ OpeningParen, // (
+ ClosingParen, // )
+ OpeningBracket, // [
+ ClosingBracket, // ]
+ OpeningBrace, // {
+ ClosingBrace, // }
+
+ // Operators
+ Plus, // +
+ PlusPlus, // ++
+ Minus, // -
+ Star, // *
+ StarStar, // **
+ Slash, // /
+ Perc, // %
+ Tilde, // ~
+
+ PlusEq, // +=
+ PlusPlusEq, // ++=
+ MinusEq, // -=
+ StarEq, // *=
+ StarStarEq, // **=
+ SlashEq, // /=
+ PercEq, // %=
+
+ Amp, // &
+ AmpAmp, // &&
+ Pipe, // |
+ PipePipe, // ||
+
+ Eq, // =
+ EqEq, // ==
+ Bang, // !
+ BangBang, // !!
+ BangEq, // !=
+
+ Lt, // <
+ LtLt, // <<
+ LtEq, // <=
+ Gt, // >
+ GtGt, // >>
+ GtEq, // >=
+
+ Comma,
+
+ Question, // ?
+ QuestionDot, // ?.
+ QuestionQuestion, // ??
+ Dot, // .
+ DotDot, // ..
+
+ Colon, // :
+ ColonColon, // ::
+ SemiColon, // ;
+
+ Arrow, // ->
+
+ // Keywords
+ Val,
+ Var,
+
+ Fn,
+
+ If,
+ Else,
+
+ While,
+ For,
+ In,
+
+ Loop,
+ Break,
+ Continue,
+
+ As,
// Misc
Literal(Literal),
@@ -79,3 +143,11 @@ impl<'a> Iterator for Lexer<'a> {
unimplemented!()
}
}
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn basic_test_a() {
+ //
+ }
+}