diff options
author | Aleksey Kladov <[email protected]> | 2017-12-31 12:29:09 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2017-12-31 12:29:09 +0000 |
commit | a071e09412d602d184a70b4b1fc0158fafd3e38e (patch) | |
tree | f857392d2f88233c14f11f8206647a23c81dafe3 /src/lexer | |
parent | d76d7d2a7426e34b0fb358029cbaa2d71f0118e8 (diff) |
Lexer: more symbols
Diffstat (limited to 'src/lexer')
-rw-r--r-- | src/lexer/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lexer/mod.rs b/src/lexer/mod.rs index d66046ca1..be86416c4 100644 --- a/src/lexer/mod.rs +++ b/src/lexer/mod.rs | |||
@@ -59,6 +59,13 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind { | |||
59 | '~' => return TILDE, | 59 | '~' => return TILDE, |
60 | '?' => return QUESTION, | 60 | '?' => return QUESTION, |
61 | '$' => return DOLLAR, | 61 | '$' => return DOLLAR, |
62 | '&' => return AMPERSAND, | ||
63 | '|' => return PIPE, | ||
64 | '+' => return PLUS, | ||
65 | '*' => return STAR, | ||
66 | '/' => return SLASH, | ||
67 | '^' => return CARET, | ||
68 | '%' => return PERCENT, | ||
62 | 69 | ||
63 | // Multi-byte tokens. | 70 | // Multi-byte tokens. |
64 | '.' => return match (ptr.next(), ptr.nnext()) { | 71 | '.' => return match (ptr.next(), ptr.nnext()) { |
@@ -103,6 +110,12 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind { | |||
103 | } | 110 | } |
104 | _ => NOT, | 111 | _ => NOT, |
105 | }, | 112 | }, |
113 | '-' => return if ptr.next_is('>') { | ||
114 | ptr.bump(); | ||
115 | THIN_ARROW | ||
116 | } else { | ||
117 | MINUS | ||
118 | }, | ||
106 | 119 | ||
107 | // If the character is an ident start not followed by another single | 120 | // If the character is an ident start not followed by another single |
108 | // quote, then this is a lifetime name: | 121 | // quote, then this is a lifetime name: |