Skip to content

Commit

Permalink
Add missing keywords to rust. (#1634)
Browse files Browse the repository at this point in the history
Adds `dyn`, `Self`, and `union` to the list of rust keywords.
  • Loading branch information
ralfbiedert authored and RunDevelopment committed Nov 29, 2018
1 parent 38def33 commit 3590edd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/prism-rust.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Prism.languages.rust = {
pattern: /'[^\s>']+/,
alias: 'symbol'
},
'keyword': /\b(?:abstract|alignof|as|be|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|offsetof|once|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/,
'keyword': /\b(?:abstract|alignof|as|be|box|break|const|continue|crate|do|dyn|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|offsetof|once|override|priv|pub|pure|ref|return|sizeof|static|self|Self|struct|super|true|trait|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,

'attribute': {
pattern: /#!?\[.+?\]/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-rust.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions tests/languages/rust/keyword_feature.test
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
abstract alignof as
be box break const
continue crate do
continue crate do dyn
else enum extern
false final fn for
if impl in let loop
match mod move mut
offsetof once override
priv pub pure ref
return sizeof static
self struct super
self Self struct super
true trait type typeof
unsafe unsized use
union unsafe unsized use
virtual where while
yield

Expand All @@ -19,17 +19,17 @@ yield
[
["keyword", "abstract"], ["keyword", "alignof"], ["keyword", "as"],
["keyword", "be"], ["keyword", "box"], ["keyword", "break"], ["keyword", "const"],
["keyword", "continue"], ["keyword", "crate"], ["keyword", "do"],
["keyword", "continue"], ["keyword", "crate"], ["keyword", "do"], ["keyword", "dyn"],
["keyword", "else"], ["keyword", "enum"], ["keyword", "extern"],
["keyword", "false"], ["keyword", "final"], ["keyword", "fn"], ["keyword", "for"],
["keyword", "if"], ["keyword", "impl"], ["keyword", "in"], ["keyword", "let"], ["keyword", "loop"],
["keyword", "match"], ["keyword", "mod"], ["keyword", "move"], ["keyword", "mut"],
["keyword", "offsetof"], ["keyword", "once"], ["keyword", "override"],
["keyword", "priv"], ["keyword", "pub"], ["keyword", "pure"], ["keyword", "ref"],
["keyword", "return"], ["keyword", "sizeof"], ["keyword", "static"],
["keyword", "self"], ["keyword", "struct"], ["keyword", "super"],
["keyword", "self"], ["keyword", "Self"], ["keyword", "struct"], ["keyword", "super"],
["keyword", "true"], ["keyword", "trait"], ["keyword", "type"], ["keyword", "typeof"],
["keyword", "unsafe"], ["keyword", "unsized"], ["keyword", "use"],
["keyword", "union"], ["keyword", "unsafe"], ["keyword", "unsized"], ["keyword", "use"],
["keyword", "virtual"], ["keyword", "where"], ["keyword", "while"],
["keyword", "yield"]
]
Expand Down

0 comments on commit 3590edd

Please sign in to comment.