File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ pub enum Token {
2727 Slash ,
2828 LeftParen ,
2929 RightParen ,
30+ LeftBracket ,
31+ RightBracket ,
3032 Assigment ,
3133 Dot ,
3234 Comma ,
@@ -60,7 +62,7 @@ pub struct Lexer<'a> {
6062}
6163
6264impl < ' a > Lexer < ' a > {
63- pub fn new ( input : & ' a str ) -> Lexer {
65+ pub fn new ( input : & ' a str ) -> Lexer < ' a > {
6466 let mut chars = input. chars ( ) ;
6567 Lexer {
6668 current : chars. next ( ) ,
@@ -156,6 +158,15 @@ impl<'a> Lexer<'a> {
156158 tokens. push ( Token :: RightParen ) ;
157159 self . advance ( ) ;
158160 }
161+ '{' => {
162+ tokens. push ( Token :: LeftBracket ) ;
163+ self . advance ( ) ;
164+
165+ }
166+ '}' => {
167+ tokens. push ( Token :: RightBracket ) ;
168+ self . advance ( ) ;
169+ }
159170 '<' => {
160171 if Some ( '=' ) == self . input . clone ( ) . next ( ) {
161172 tokens. push ( Token :: LessThanOrEqual ) ;
You can’t perform that action at this time.
0 commit comments