From bb95375f8b24141bf7dfe5a8b1bba5c995f61253 Mon Sep 17 00:00:00 2001 From: Cody Date: Mon, 27 Mar 2023 04:47:00 -0500 Subject: hm --- src/lexer.rs | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 84 insertions(+), 12 deletions(-) (limited to 'src/lexer.rs') 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() { + // + } +} -- cgit v1.2.3