From a071e09412d602d184a70b4b1fc0158fafd3e38e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 31 Dec 2017 15:29:09 +0300 Subject: Lexer: more symbols --- src/lexer/mod.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/lexer') 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 { '~' => return TILDE, '?' => return QUESTION, '$' => return DOLLAR, + '&' => return AMPERSAND, + '|' => return PIPE, + '+' => return PLUS, + '*' => return STAR, + '/' => return SLASH, + '^' => return CARET, + '%' => return PERCENT, // Multi-byte tokens. '.' => return match (ptr.next(), ptr.nnext()) { @@ -103,6 +110,12 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind { } _ => NOT, }, + '-' => return if ptr.next_is('>') { + ptr.bump(); + THIN_ARROW + } else { + MINUS + }, // If the character is an ident start not followed by another single // quote, then this is a lifetime name: -- cgit v1.2.3