Improve Julia syntax highlighting (#2643)
Specifically, do not allow multiline single-quote strings, which are not a thing in Julia. The existing rule broke when adjoints were used, such as `b = a'`. The syntax rules have been copied from Rust, which also uses single ticks for character literals, and also uses the ' symbol for things unrelated to chars.
This commit is contained in:
parent
0a080ba03c
commit
9a10cac598
1 changed files with 4 additions and 5 deletions
|
@ -39,13 +39,12 @@ rules:
|
||||||
rules:
|
rules:
|
||||||
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{1,4}|U[0-9A-Fa-f]{1,8})"
|
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{1,4}|U[0-9A-Fa-f]{1,8})"
|
||||||
|
|
||||||
|
# Lifted from Rust's syntax highlighting
|
||||||
|
- constant.string: "'(\\\\.|.)'"
|
||||||
- constant.string:
|
- constant.string:
|
||||||
start: "'"
|
start: "'\""
|
||||||
end: "'"
|
end: "'"
|
||||||
skip: "\\\\."
|
rules: []
|
||||||
rules:
|
|
||||||
- error: "..+"
|
|
||||||
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{1,4}|U[0-9A-Fa-f]{1,8})"
|
|
||||||
|
|
||||||
- comment:
|
- comment:
|
||||||
start: "#="
|
start: "#="
|
||||||
|
|
Loading…
Reference in a new issue