diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-01-28 21:41:29 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-01-28 21:41:29 +0100 |
| commit | 5dad27d80e537fce2e93a01242f6f7e63e113aec (patch) | |
| tree | e945766781328a4afa75b87ca43455cf90194030 /lexers/rust.lua | |
| parent | a649cfb83e65cb88111527b6fe92e92ecc38a71e (diff) | |
| download | vis-5dad27d80e537fce2e93a01242f6f7e63e113aec.tar.gz vis-5dad27d80e537fce2e93a01242f6f7e63e113aec.tar.xz | |
lexer: snyc with upstream scintillua 3.6.3-1
Diffstat (limited to 'lexers/rust.lua')
| -rw-r--r-- | lexers/rust.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lexers/rust.lua b/lexers/rust.lua index f8ad5a8..60834fb 100644 --- a/lexers/rust.lua +++ b/lexers/rust.lua @@ -1,4 +1,4 @@ --- Copyright 2015-2016 Alejandro Baez (https://twitter.com/a_baez). See LICENSE. +-- Copyright 2015-2016 Alejandro Baez (https://keybase.io/baez). See LICENSE. -- Rust LPeg lexer. local l = require("lexer") @@ -18,11 +18,11 @@ local comment = token(l.COMMENT, line_comment + block_comment) -- Strings. local sq_str = P('L')^-1 * l.delimited_range("'") local dq_str = P('L')^-1 * l.delimited_range('"') -local raw_str = "##" * (l.any - '##')^0 * P("##")^-1 +local raw_str = '#"' * (l.any - '#')^0 * P('#')^-1 local string = token(l.STRING, dq_str + raw_str) -- Numbers. -local number = token(l.NUMBER, l.float + +local number = token(l.NUMBER, l.float + (l.dec_num + "_")^1 + "0b" * (l.dec_num + "_")^1 + l.integer) -- Keywords. @@ -33,10 +33,11 @@ local keyword = token(l.KEYWORD, word_match{ 'fn', 'for', 'if', 'impl', 'in', 'let', 'loop', 'macro', 'match', 'mod', 'move', 'mut', "offsetof", 'override', 'priv', - 'pub', 'pure', 'ref', 'return', 'sizeof', - 'static', 'self', 'struct', 'super', 'true', - 'trait', 'type', 'typeof', 'unsafe', 'unsized', - 'use', 'virtual', 'where', 'while', 'yield' + 'proc', 'pub', 'pure', 'ref', 'return', + 'Self', 'self', 'sizeof', 'static', 'struct', + 'super', 'trait', 'true', 'type', 'typeof', + 'unsafe', 'unsized', 'use', 'virtual', 'where', + 'while', 'yield' }) -- Library types |
