Julia syntax improvements (#2415)

* fix D syntax highlighting for integer literals with underscores

* improve julia syntax highlighting for strings, chars and operators
This commit is contained in:
Mikko
2022-05-15 23:00:59 +03:00
committed by GitHub
parent 656e0a8a7b
commit c57c5c04e5
2 changed files with 20 additions and 10 deletions

View File

@@ -19,30 +19,40 @@ rules:
# decorators
- identifier.macro: "@[A-Za-z0-9_]+"
# operators
- symbol.operator: "[-+*/|=%<>&~^]|\\b(in|isa|where)\\b"
- symbol.operator: "[:+*|=!%~<>/\\-?&\\\\÷∈∉∘]|\\b(in|isa|where)\\b"
# for some reason having ^ in the same regex with the other operators broke things
- symbol.operator: "\\^"
# parentheses
- symbol.brackets: "([(){}]|\\[|\\])"
# numbers
- constant.number: "\\b([0-9]+(_[0-9]+)*|0x[0-9a-fA-F]+(_[0-9a-fA-F]+)*|0b[01]+(_[01]+)*|0o[0-7]+(_[0-7]+)*|Inf(16|32|64)?|NaN(16|32|64)?)\\b"
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^']){1}'"
- constant.string:
start: "\"\"\""
end: "\"\"\""
rules: []
- constant.string:
start: "\"[^\"]|\"$"
start: "\""
end: "\""
rules: []
skip: "\\\\."
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})"
- comment:
start: "#[^=]|#$"
end: "$"
rules: []
- constant.string:
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})"
- comment:
start: "#="
end: "=#"
rules: []
- comment:
start: "#"
end: "$"
rules: []