Update rust syntax: don't highlight lifetimes (#2164)
Work-around rust lifetimes and character literals both using single quotes.
This commit is contained in:
parent
42a9302636
commit
84a490f14c
1 changed files with 8 additions and 4 deletions
|
@ -34,12 +34,16 @@ rules:
|
|||
rules: []
|
||||
|
||||
# Character literals
|
||||
# NOTE: This is an ugly hack to work around the fact that rust uses
|
||||
# single quotes both for character literals and lifetimes.
|
||||
# Match all character literals.
|
||||
- constant.string: "'(\\\\.|.)'"
|
||||
# Match the '"' literal which would otherwise match
|
||||
# as a double quoted string and destroy the highlighting.
|
||||
- constant.string:
|
||||
start: "'"
|
||||
start: "'\""
|
||||
end: "'"
|
||||
skip: '\\.'
|
||||
rules:
|
||||
- constant.specialChar: '\\.'
|
||||
rules: []
|
||||
|
||||
- comment:
|
||||
start: "//"
|
||||
|
|
Loading…
Reference in a new issue