diff options
author | Aleksey Kladov <[email protected]> | 2017-12-30 15:25:37 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2017-12-30 15:25:37 +0000 |
commit | 412948c0e2f34b1db13201bf533468241ee881e6 (patch) | |
tree | 20664c2903806c87ceeb09bcc189b41a6c13192c /src/lexer | |
parent | fad3e50987311a3c42a45bd3d9dbcf7c7a77e544 (diff) |
More symbols
Diffstat (limited to 'src/lexer')
-rw-r--r-- | src/lexer/mod.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lexer/mod.rs b/src/lexer/mod.rs index d2d4aaa22..5255c3d56 100644 --- a/src/lexer/mod.rs +++ b/src/lexer/mod.rs | |||
@@ -52,6 +52,8 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind { | |||
52 | '~' => return TILDE, | 52 | '~' => return TILDE, |
53 | '?' => return QUESTION, | 53 | '?' => return QUESTION, |
54 | '$' => return DOLLAR, | 54 | '$' => return DOLLAR, |
55 | |||
56 | // Multi-byte tokens. | ||
55 | '.' => return match (ptr.next(), ptr.nnext()) { | 57 | '.' => return match (ptr.next(), ptr.nnext()) { |
56 | (Some('.'), Some('.')) => { | 58 | (Some('.'), Some('.')) => { |
57 | ptr.bump(); | 59 | ptr.bump(); |
@@ -76,6 +78,24 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind { | |||
76 | } | 78 | } |
77 | _ => COLON | 79 | _ => COLON |
78 | }, | 80 | }, |
81 | '=' => return match ptr.next() { | ||
82 | Some('=') => { | ||
83 | ptr.bump(); | ||
84 | EQEQ | ||
85 | } | ||
86 | Some('>') => { | ||
87 | ptr.bump(); | ||
88 | FAT_ARROW | ||
89 | } | ||
90 | _ => EQ, | ||
91 | }, | ||
92 | '!' => return match ptr.next() { | ||
93 | Some('=') => { | ||
94 | ptr.bump(); | ||
95 | NEQ | ||
96 | } | ||
97 | _ => NOT, | ||
98 | }, | ||
79 | _ => (), | 99 | _ => (), |
80 | } | 100 | } |
81 | ERROR | 101 | ERROR |