Update rust syntax: char literal
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
@@ -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: []
-
