mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 23:05:40 -04:00
Fix rust syntax file to recognize byte strings and c strings. (#3452)
In rust, there are some prefixes that may be part of the string literal. String literals of the form b"test" (and br##"test"## etc) are byte strings (as opposed to unicode strings), and similarly, string literals of the form c"test" are C zero-terminated strings. Hence, added optional prefixes to each of the string regular expressions so the prefix will be recognized as part of the string. Built and tested after fix. Co-authored-by: James Corey <jc-git@neniam.net>
This commit is contained in:
parent
d8f7928b74
commit
2308bc5555
@ -22,29 +22,29 @@ rules:
|
|||||||
- type: "\\b(bool|str|isize|usize|((i|u)(8|16|32|64))|f32|f64)\\b"
|
- type: "\\b(bool|str|isize|usize|((i|u)(8|16|32|64))|f32|f64)\\b"
|
||||||
|
|
||||||
- constant.string:
|
- constant.string:
|
||||||
start: "\""
|
start: "[bc]?\""
|
||||||
end: "\""
|
end: "\""
|
||||||
skip: '\\.'
|
skip: '\\.'
|
||||||
rules:
|
rules:
|
||||||
- constant.specialChar: '\\.'
|
- constant.specialChar: '\\.'
|
||||||
|
|
||||||
- constant.string:
|
- constant.string:
|
||||||
start: "r#\""
|
start: "[bc]?r#\""
|
||||||
end: "\"#"
|
end: "\"#"
|
||||||
rules: []
|
rules: []
|
||||||
|
|
||||||
- constant.string:
|
- constant.string:
|
||||||
start: "r##\""
|
start: "[bc]?r##\""
|
||||||
end: "\"##"
|
end: "\"##"
|
||||||
rules: []
|
rules: []
|
||||||
|
|
||||||
- constant.string:
|
- constant.string:
|
||||||
start: "r###\""
|
start: "[bc]?r###\""
|
||||||
end: "\"###"
|
end: "\"###"
|
||||||
rules: []
|
rules: []
|
||||||
|
|
||||||
- constant.string:
|
- constant.string:
|
||||||
start: "r####+\""
|
start: "[bc]?r####+\""
|
||||||
end: "\"####+"
|
end: "\"####+"
|
||||||
rules: []
|
rules: []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user