mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-06 07:00:24 +09:00
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:
@@ -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: []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user