Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Julia.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,18 @@ contexts:
(?: # Dashes betwen numeric symbols (11 = 1_1) are allowed everywhere.
0b[0-1](?:_?[0-1])*| # binary
0o[0-7](?:_?[0-7])*| # octal
0x[\da-fA-F](?:_?[\da-fA-F])*| # hex
0x(?:
(?:
\.[\da-fA-F](?:_?[\da-fA-F])*| # 0x.AA
[\da-fA-F](?:_?[\da-fA-F])*(?:\.(?:[\da-fA-F](?:_?[\da-fA-F])*)?)? # 0xAA.AA, 0xAA.
)(?:[pP][-+]?\d(?:_?\d)*)| # Hex float literal must contain p or P.
[\da-fA-F](?:_?[\da-fA-F])* # 0xAA_AA
)| # hex
(?:
\.\d(?:_?\d)*| # .11, .11
\d(?:_?\d)*(?:\.(?:\d(?:_?\d)*)?)? # 11.11, 11., 11
)
(?:e[-+]?\d(?:_?\d)*)? # Any of the above followed by e+123 or similar, for scientific notation.
(?:[eEf][-+]?\d(?:_?\d)*)? # Any of the above followed by e+123 or similar, for scientific notation.
)
scope: constant.numeric.julia
push: after-expression
Expand Down
14 changes: 14 additions & 0 deletions syntax_test_julia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
# ^^^^^^^^ constant.numeric
1.e-123
# ^^^^^^^ constant.numeric
1E+3
# ^^^^ constant.numeric
1f-3
# ^^^^ constant.numeric
11
# ^^ constant.numeric
.11
Expand All @@ -56,6 +60,16 @@
# ^^^^^^^^^^ constant.numeric
0xa_3_f
# ^^^^^^^ constant.numeric
0x.4p-22
# ^^^^^^^^ constant.numeric
0xABCp1
# ^^^^^^^ constant.numeric
0x.AB_CDP+11
# ^^^^^^^^^^^^ constant.numeric
0x12.34p12
# ^^^^^^^^^^ constant.numeric
0xAA.p+0
# ^^^^^^^^ constant.numeric
0b1_0_1
# ^^^^^^^ constant.numeric
1.3_2e+1_2_3
Expand Down