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
|
# Octal integer literals are deprecated
|
||||||
- error: "(0[0-7_]*)(L[uU]?|[uU]L?)?"
|
- error: "(0[0-7_]*)(L[uU]?|[uU]L?)?"
|
||||||
# Decimal integer literals
|
# 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
|
# Binary integer literals
|
||||||
- constant: "(0[bB][01_]*)(L[uU]?|[uU]L?)?"
|
- constant: "(0[bB][01_]*)(L[uU]?|[uU]L?)?"
|
||||||
# Decimal float literals
|
# Decimal float literals
|
||||||
|
|
|
@ -19,30 +19,40 @@ rules:
|
||||||
# decorators
|
# decorators
|
||||||
- identifier.macro: "@[A-Za-z0-9_]+"
|
- identifier.macro: "@[A-Za-z0-9_]+"
|
||||||
# operators
|
# 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
|
# parentheses
|
||||||
- symbol.brackets: "([(){}]|\\[|\\])"
|
- symbol.brackets: "([(){}]|\\[|\\])"
|
||||||
# numbers
|
# 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.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:
|
- constant.string:
|
||||||
start: "\"\"\""
|
start: "\"\"\""
|
||||||
end: "\"\"\""
|
end: "\"\"\""
|
||||||
rules: []
|
rules: []
|
||||||
|
|
||||||
- constant.string:
|
- constant.string:
|
||||||
start: "\"[^\"]|\"$"
|
start: "\""
|
||||||
end: "\""
|
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:
|
- constant.string:
|
||||||
start: "#[^=]|#$"
|
start: "'"
|
||||||
end: "$"
|
end: "'"
|
||||||
rules: []
|
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:
|
- comment:
|
||||||
start: "#="
|
start: "#="
|
||||||
end: "=#"
|
end: "=#"
|
||||||
rules: []
|
rules: []
|
||||||
|
|
||||||
|
- comment:
|
||||||
|
start: "#"
|
||||||
|
end: "$"
|
||||||
|
rules: []
|
||||||
|
|
Loading…
Reference in a new issue