File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ :| Esc [$4] | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | '-' | '=' | Back [$8] |-
2+ :| Tab [$6] | Q | W | E | R | T | Y | U | I | O | P | '[' | ']' | '\' [$6] |-
3+ :| Caps [$7] | A | S | D | F | G | H | J | K | L | ';' | "'" | Enter [$9] |-
4+ :| LShift [$9] | Z | X | C | V | B | N | M | ',' | '.' | '/' | RShift [$11] |-
5+ :| LCtrl [$5] | Win [$5] | LAlt [$5] | Space [$25] | RAlt [$5] | Win [$5] | App [$5] | RCtrl [$5] |-
Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ impl<'a> Lexer<'a> {
6868 self . src . next ( ) ;
6969 Some ( Token { token_type : TokenType :: RBrace , value : "}" . to_string ( ) } )
7070 }
71- '\'' => {
72- Some ( self . collect_quoted_name ( ) )
71+ '\'' | '\"' => {
72+ Some ( self . collect_quoted_name ( c ) )
7373 }
7474 _ => {
7575 Some ( self . collect_plain_name ( ) )
@@ -87,12 +87,12 @@ impl<'a> Lexer<'a> {
8787 }
8888 }
8989
90- fn collect_quoted_name ( & mut self ) -> Token {
90+ fn collect_quoted_name ( & mut self , quote : char ) -> Token {
9191 self . src . next ( ) ;
9292 let mut value = String :: new ( ) ;
9393
9494 while let Some ( & c) = self . src . peek ( ) {
95- if c == '\'' {
95+ if c == quote {
9696 self . src . next ( ) ;
9797 break ;
9898 }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ impl Parser {
2222 if self . current < self . tokens . len ( ) {
2323 Ok ( & self . tokens [ self . current ] )
2424 } else {
25- Err ( ParserError :: Err ( "a " . to_string ( ) ) )
25+ Err ( ParserError :: Err ( "EOF " . to_string ( ) ) )
2626 }
2727 }
2828
@@ -31,7 +31,7 @@ impl Parser {
3131 self . current += 1 ;
3232 Ok ( & self . tokens [ self . current - 1 ] )
3333 } else {
34- Err ( ParserError :: Err ( "a " . to_string ( ) ) )
34+ Err ( ParserError :: Err ( "EOF " . to_string ( ) ) )
3535 }
3636 }
3737
You can’t perform that action at this time.
0 commit comments