diff options
author | Phap Tran <15520599@gm.uit.edu.vn> | 2019-05-30 01:32:00 +0000 |
---|---|---|
committer | Phap Tran <15520599@gm.uit.edu.vn> | 2019-05-30 01:32:00 +0000 |
commit | 85cefd43a89f9d1addbd70954f9861b066616da6 (patch) | |
tree | 10bb9a719df161301ef05d9b39fb1e700788fc39 | |
parent | 7c1cf0b2b0c782a24754cef2f6bbe2fd3246f70e (diff) | |
download | pygments-85cefd43a89f9d1addbd70954f9861b066616da6.tar.gz |
rust: Add async, await, try keyword
-rw-r--r-- | pygments/lexers/rust.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pygments/lexers/rust.py b/pygments/lexers/rust.py index 2b9e3129..89be6963 100644 --- a/pygments/lexers/rust.py +++ b/pygments/lexers/rust.py @@ -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), |