Update rust syntax: don't highlight lifetimes (#2164)

Work-around rust lifetimes and character literals both using single quotes.
This commit is contained in:
pyfisch 2021-07-21 21:02:28 +02:00 committed by GitHub
parent 42a9302636
commit 84a490f14c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: "//"