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:
Jakob Nybo Nissen 2022-12-03 02:49:50 +01:00 committed by GitHub
parent 0a080ba03c
commit 9a10cac598
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,13 +39,12 @@ 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})"
# Lifted from Rust's syntax highlighting
- constant.string: "'(\\\\.|.)'"
- constant.string:
start: "'"
start: "'\""
end: "'"
skip: "\\\\."
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})"
rules: []
- comment:
start: "#="