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:
parent
656e0a8a7b
commit
c57c5c04e5
2 changed files with 20 additions and 10 deletions
|
@ -10,7 +10,7 @@ rules:
|
|||
# Octal integer literals are deprecated
|
||||
- error: "(0[0-7_]*)(L[uU]?|[uU]L?)?"
|
||||
# Decimal integer literals
|
||||
- constant.number: "([0-9]|[1-9][0-9_]*)(L[uU]?|[uU]L?)?"
|
||||
- constant.number: "([0-9]|[1-9][0-9_]*)(L[uU]?|[uU]L?)?\\b"
|
||||
# Binary integer literals
|
||||
- constant: "(0[bB][01_]*)(L[uU]?|[uU]L?)?"
|
||||
# Decimal float literals
|
||||
|
|
|
@ -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: []
|
||||
|
|
Loading…
Reference in a new issue