summaryrefslogtreecommitdiff
path: root/pygments/lexers/rust.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/rust.py')
-rw-r--r--pygments/lexers/rust.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/pygments/lexers/rust.py b/pygments/lexers/rust.py
index 6914f54d..f731785f 100644
--- a/pygments/lexers/rust.py
+++ b/pygments/lexers/rust.py
@@ -5,7 +5,7 @@
Lexers for the Rust language.
- :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -24,12 +24,12 @@ class RustLexer(RegexLexer):
"""
name = 'Rust'
filenames = ['*.rs', '*.rs.in']
- aliases = ['rust']
+ aliases = ['rust', 'rs']
mimetypes = ['text/rust']
keyword_types = (
words(('u8', 'u16', 'u32', 'u64', 'i8', 'i16', 'i32', 'i64',
- 'usize', 'isize', 'f32', 'f64', 'str', 'bool'),
+ 'i128', 'u128', 'usize', 'isize', 'f32', 'f64', 'str', 'bool'),
suffix=r'\b'),
Keyword.Type)
@@ -59,7 +59,7 @@ class RustLexer(RegexLexer):
tokens = {
'root': [
# rust allows a file to start with a shebang, but if the first line
- # starts with #![ then it’s not a shebang but a crate attribute.
+ # starts with #![ then it's not a shebang but a crate attribute.
(r'#![^[\r\n].*$', Comment.Preproc),
default('base'),
],
@@ -78,10 +78,10 @@ class RustLexer(RegexLexer):
(r"""\$([a-zA-Z_]\w*|\(,?|\),?|,?)""", Comment.Preproc),
# Keywords
(words((
- 'as', 'box', 'const', 'crate', 'else', 'extern',
- 'for', 'if', 'impl', 'in', 'loop', 'match', 'move',
- 'mut', 'pub', 'ref', 'return', 'static', 'super',
- 'trait', 'unsafe', 'use', 'where', 'while'), suffix=r'\b'),
+ 'as', 'async', 'await', 'box', 'const', 'crate', 'else',
+ 'extern', 'for', 'if', 'impl', 'in', 'loop', 'match', 'move',
+ 'mut', 'pub', 'ref', 'return', 'static', 'super', 'trait',
+ 'try', 'unsafe', 'use', 'where', 'while'), suffix=r'\b'),
Keyword),
(words(('abstract', 'alignof', 'become', 'do', 'final', 'macro',
'offsetof', 'override', 'priv', 'proc', 'pure', 'sizeof',
@@ -95,7 +95,7 @@ class RustLexer(RegexLexer):
(r'(default)(\s+)(type|fn)\b', bygroups(Keyword, Text, Keyword)),
keyword_types,
(r'self\b', Name.Builtin.Pseudo),
- # Prelude (taken from Rust’s src/libstd/prelude.rs)
+ # Prelude (taken from Rust's src/libstd/prelude.rs)
builtin_types,
# Path seperators, so types don't catch them.
(r'::\b', Text),