Update rust syntax: char literal (#2162)

Highlight character literals started with a single quote (').
Importantly this ensures correct highlighting for the character literal '"'.
Limitation: rust char literals contain exactly one character, however this isn't checked by the highlighter.

Closes #2160
This commit is contained in:
pyfisch 2021-07-21 18:37:41 +02:00 committed by GitHub
parent ae0c28a03d
commit 42a9302636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,15 +24,23 @@ rules:
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
skip: '\\.'
rules:
- constant.specialChar: "\\\\."
- constant.specialChar: '\\.'
- constant.string:
start: "r#+\""
end: "\"#+"
rules: []
# Character literals
- constant.string:
start: "'"
end: "'"
skip: '\\.'
rules:
- constant.specialChar: '\\.'
- comment:
start: "//"
end: "$"
@ -49,4 +57,3 @@ rules:
start: "#!\\["
end: "\\]"
rules: []