-
Notifications
You must be signed in to change notification settings - Fork 34
/
syntax_test_julia.jl
719 lines (633 loc) · 23.1 KB
/
syntax_test_julia.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
# SYNTAX TEST "Packages/Julia/Julia.sublime-syntax"
# For information on how this file is used, see
# https://www.sublimetext.com/docs/3/syntax.html#testing
# Run tests by pressing `ctrl(or cmd)+shift+b`, i.e. run the `build` command
#=
command block
# ^^^^^^^^^^^^^ comment.block.number-equal-sign
=#
# <- comment.block.number-equal-sign punctuation.definition.comment.number-equal-sign
# Code section ####
# ^^^^^^^^^^^^ comment.line.number-sign.julia entity.name.section.julia
# Code section ====
# ^^^^^^^^^^^^ comment.line.number-sign.julia entity.name.section.julia
# = ====
# ^ comment.line.number-sign.julia entity.name.section.julia
#=====
#^ -comment.line.number-sign.julia entity.name.section.julia
=====#
##
## NUMBERS ====
##
0b101
# ^^^^^ constant.numeric
0o7
# ^^^ constant.numeric
0xa3
# ^^^^ constant.numeric
1e+123
# ^^^^^^ constant.numeric
12e123
# ^^^^^^ constant.numeric
1.32e+123
# ^^^^^^^^^ constant.numeric
.32e+123
# ^^^^^^^^ constant.numeric
1.e-123
# ^^^^^^^ constant.numeric
11
# ^^ constant.numeric
.11
# ^^^ constant.numeric
11.
# ^^^ constant.numeric
11.11
# ^^^^^ constant.numeric
2.a
# ^^ constant.numeric
# ^ meta.generic-name
# (issue 37)
123_4_56_7
# ^^^^^^^^^^ constant.numeric
0xa_3_f
# ^^^^^^^ constant.numeric
0b1_0_1
# ^^^^^^^ constant.numeric
1.3_2e+1_2_3
# ^^^^^^^^^^^^ constant.numeric.julia
# (issue 51)
e2
# ^^ meta.generic-name
2e
# ^ constant.numeric
# ^ meta.generic-name
2e2
# ^^^ constant.numeric
e+2
# ^ meta.generic-name
# ^ keyword.operator
# ^ constant.numeric
2+e
# ^ constant.numeric
# ^ keyword.operator
# ^ meta.generic-name
##
## CONSTANTS ====
##
true
# ^^^^ constant.language
false
# ^^^^^ constant.language
nothing
# ^^^^^^^ constant.language
missing
# ^^^^^^^ constant.language
undef
# ^^^^^ constant.language
NaN
# ^^^ constant.language
NaN16
# ^^^^^ constant.language
NaN32
# ^^^^^ constant.language
NaN64
# ^^^^^ constant.language
Inf
# ^^^ constant.language
Inf16
# ^^^^^ constant.language
Inf32
# ^^^^^ constant.language
Inf64
# ^^^^^ constant.language
ℯ
# ^ constant.language
pi
# ^^ constant.language
π
# ^ constant.language
im
# ^^ constant.language
ARGS
# ^^^^ constant.language
C_NULL
# ^^^^^^ constant.language
ENDIAN_BOM
# ^^^^^^^^^^ constant.language
ENV
# ^^^ constant.language
LOAD_PATH
# ^^^^^^^^^ constant.language
PROGRAM_FILE
# ^^^^^^^^^^^^ constant.language
STDERR
# ^^^^^^ constant.language
STDIN
# ^^^^^ constant.language
STDOUT
# ^^^^^^ constant.language
VERSION
# ^^^^^^^ constant.language
##
## Variables and Functions ====
##
bar
# ^^^ meta.generic-name.julia
foo.bar
# ^^^ meta.generic-name
# ^ punctuation.accessor.dot
# ^^^ meta.generic-name
foo.bar = 1
# ^^^ meta.generic-name.julia
# ^ punctuation.accessor.dot.julia
# ^^^ meta.generic-name.julia
# ^ keyword.operator.assignment.julia
foo.bar(x)
# ^^^ meta.function-call.julia variable.function.julia meta.generic-name.julia
# ^ meta.function-call.julia punctuation.accessor.dot.julia
# ^^^ meta.function-call.julia variable.function.julia meta.generic-name.julia
# ^ meta.function-call.julia meta.function-call.arguments.julia meta.generic-name.julia
(foo).bar(x)
# ^^^ meta.group.julia meta.generic-name.julia
# ^ punctuation.accessor.dot.julia
# ^^^ meta.function-call.julia variable.function.julia meta.generic-name.julia
bar(x = 1, y = 2, kwargs...)
# ^^^ meta.function-call variable.function
# ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.julia
# ^ meta.function-call.arguments.julia variable.parameter.julia
# ^ meta.function-call.arguments.julia keyword.operator.assignment.julia
# ^ meta.function-call.arguments.julia variable.parameter.julia
# ^ meta.function-call.arguments.julia keyword.operator.assignment.julia
# ^ meta.function-call.arguments.julia constant.numeric.julia
# ^^^^^^ meta.function-call.arguments.julia meta.generic-name.julia
# ^^^ meta.function-call.arguments.julia keyword.operator.splat.julia
bar(x == 1)
# ^^^ meta.function-call.julia variable.function.julia meta.generic-name.julia
# ^ meta.function-call.arguments.julia meta.generic-name.julia
# ^^ meta.function-call.arguments.julia keyword.operator.julia
# ^ meta.function-call.arguments.julia constant.numeric.julia
(bar())
# ^^^^^^^ meta.group.julia
# ^^^ meta.function-call.julia variable.function.julia
# ^^ meta.function-call.julia punctuation.section.arguments
bar.()
(bar).()
# ^^^ meta.generic-name.julia
# ^ keyword.operator.broadcast.julia
# ^^ meta.function-call.julia punctuation.section.arguments
(bar)(x, y) = 1
# ^^^ meta.group.julia meta.generic-name.julia
# ^^^^ meta.function.inline.julia meta.function.parameters.julia
bar(x, y) = 2
# ^^^ meta.function.inline.julia entity.name.function.julia meta.generic-name.julia
# ^ meta.function.inline.julia meta.function.parameters.julia variable.parameter.julia
# ^ meta.function.inline.julia meta.function.parameters.julia variable.parameter.julia
bar(a = 1, z = abc) = 1
# ^ meta.function.inline.julia meta.function.parameters.julia variable.parameter.julia
# ^^^ meta.function.inline.julia meta.function.parameters.julia meta.generic-name.julia
# ^^^ meta.function.inline.julia entity.name.function.julia
bar(a = 1) == 1
# ^^^ meta.function-call.julia variable.function.julia meta.generic-name.julia
# ^^ keyword.operator.julia
foo.bar(x) = 1
# ^^^^^^^ entity.name.function.julia
# ^ punctuation.accessor.dot.julia
# ^ meta.function.inline.julia meta.function.parameters.julia variable.parameter.julia
function foo(x, y)
# ^^^ meta.function.julia entity.name.function.julia meta.generic-name.julia
# ^ meta.function.julia meta.function.parameters.julia variable.parameter.julia
# ^ meta.function.julia meta.function.parameters.julia punctuation.separator.parameters.julia
# ^ meta.function.julia meta.function.parameters.julia variable.parameter.julia
end
function bar.foo(x, y)
# ^^^ meta.function.julia entity.name.function.julia meta.generic-name.julia
# ^ meta.function.julia entity.name.function.julia punctuation.accessor.dot.julia
# ^^^ meta.function.julia entity.name.function.julia meta.generic-name.julia
end
function (foo)(x, y)
# ^^^ meta.function.julia meta.group.julia entity.name.function.julia meta.generic-name.julia
# ^^^^ meta.function.julia meta.function.parameters.julia
end
(
# <- meta.group
function foo
# ^^^ meta.function.julia entity.name.function.julia meta.generic-name.julia
end
#
# <- meta.group
)
(
# <- meta.group
function (x, y)
# ^^^^ meta.function.julia meta.function.parameters.julia
end
#
# <- meta.group
)
function (f::Mytype)(x, y)
# ^ meta.function.julia meta.generic-name.julia
# ^^^^ meta.function.julia meta.function.parameters.julia
end
(f::Mytype)(x, y)
# ^^^^^^^^^^^^^^^^^ meta.function-call.julia
# ^^^^ meta.function-call.julia meta.function-call.arguments.julia
(f::Mytype)(x, y) = 1
# ^^^^^^^^^^^^^^^^^ meta.function.inline.julia
# ^^^^ meta.function.inline.julia meta.function.parameters.julia
bar().(x = 1, y = 2)
# ^ keyword.operator.broadcast.julia
# ^^^^^^^^^^^^ meta.function-call.julia meta.function-call.arguments.julia
filter!()
# ^^^^^^^ meta.function-call.julia variable.function.julia support.function.julia
length([1, 2])
# ^^^^^^ meta.function-call.julia variable.function.julia support.function.julia
length(x::Mytype) = 1
# ^^^^^^ meta.function.inline.julia entity.name.function.julia
Base.filter!()
# ^^^^ meta.function-call.julia variable.function.julia support.module.julia
# ^ meta.function-call.julia punctuation.accessor.dot.julia
# ^^^^^^^ meta.function-call.julia variable.function.julia support.function.julia
Base.length([1, 2])
# ^^^^ meta.function-call.julia variable.function.julia support.module.julia
# ^ meta.function-call.julia punctuation.accessor.dot.julia
# ^^^^^^ meta.function-call.julia variable.function.julia support.function.julia
Base.length(x::Mytype) = 1
# ^^^^ meta.function.inline.julia entity.name.function.julia
# ^ meta.function.inline.julia entity.name.function.julia punctuation.accessor.dot.julia
# ^^^^^^ meta.function.inline.julia entity.name.function.julia
foo((x), ((y))) = 1
# ^^^ meta.function.inline.julia entity.name.function.julia meta.generic-name.julia
# ^ meta.function.inline.julia meta.function.parameters.julia variable.parameter.julia
# ^ meta.function.inline.julia meta.function.parameters.julia variable.parameter.julia
# ##
# ## Lambda functions ====
# ##
# x -> x^2
# # ^ meta.function.lambda.julia meta.function.parameters.julia variable.parameter.julia
# # ^^ meta.function.lambda.julia keyword.operator.arrow.julia
# x::Int -> x^2
# # ^ meta.function.lambda.julia meta.function.parameters.julia variable.parameter.julia
# # ^^ meta.function.lambda.julia keyword.operator.arrow.julia
# () -> 3^2
# # ^^ meta.function.lambda.julia punctuation.section.parameters
# # ^^ meta.function.lambda.julia keyword.operator.arrow.julia
# (x::Int, y) -> x + y
# # ^^^^^^^^^^ meta.function.lambda.julia
# # ^^^ meta.function.lambda.julia meta.function.parameters.julia support.type.julia
# # ^^ meta.function.lambda.julia keyword.operator.arrow.julia
# (::Int) -> 1
# # ^^^^^^^^^^ meta.function.lambda.julia
# ( (x=1) -> x )
# # ^ meta.group.julia
# # ^ - meta.funciton.lambda.julia
##
## UNICODE WORD BOUDARIES ====
##
# Unicode and numbers in names (issue 18)
β1 = 5
# ^^ meta.generic-name
β3(x)
# ^^ variable.function
β2(x) = x
# ^^ entity.name.function
∇1 = 5
# ^^ meta.generic-name
∇3(x)
# ^^ variable.function
∇2(∇2) = x
# ^^ entity.name.function
# ^^^ meta.function meta.function.parameters
##
## RANGES ====
##
# (issue 14)
a:b
# ^ meta.generic-name
# ^ keyword.operator
# ^ meta.generic-name
1.:a
# ^^ constant.numeric
# ^ keyword.operator
# ^ meta.generic-name
a:2.
# ^ meta.generic-name
# ^ keyword.operator
# ^^ constant.numeric
23.:31.
# ^^^ constant.numeric
# ^ keyword.operator
# ^^^ constant.numeric
β:f()
# ^ meta.generic-name
# ^ keyword.operator
# ^ variable.function
f():1
# ^ variable.function
# ^ keyword.operator
# ^ constant.numeric
##
## TERNARY OPERATORS ====
##
a ? b :c
# ^ meta.generic-name
# ^ keyword.operator
# ^ meta.generic-name
# ^ keyword.operator
# ^ meta.generic-name
a? b : c
# ^ invalid.operator.julia
a ?b : c
# ^ invalid.operator.julia
##
## Types ====
##
Array{Int, 2}
# ^^^^^ meta.parametric-type.julia support.type.julia
# ^ meta.parametric-type.julia punctuation.section.parameter.begin.julia
# ^^^ meta.parametric-type.julia meta.parametric-type.parameters.julia support.type.julia
Foo{Bar, 2}
# ^^^ meta.parametric-type.julia meta.generic-name.julia
# ^ meta.parametric-type.julia punctuation.section.parameter.begin.julia
# ^^^ meta.parametric-type.julia meta.parametric-type.parameters.julia meta.generic-name.julia
y::MyArray{T, 2} where T
# ^ meta.generic-name.julia
# ^^ keyword.operator.colons.julia
# ^^^^^^^ meta.parametric-type.julia meta.generic-name.julia
# ^^^^^ meta.where-clause.julia keyword.control.julia
# ^ meta.where-clause.julia meta.generic-name.julia
# ^ - meta.where-clause.julia
MyArray{T, 2} where T >: Int
# ^^^^^^^ meta.parametric-type.julia meta.generic-name.julia
# ^^^^^ meta.where-clause.julia keyword.control.julia
# ^ meta.where-clause.julia meta.generic-name.julia
# ^^ meta.where-clause.julia keyword.operator.superset.julia
# ^^^ meta.where-clause.julia support.type.julia
MyArray{T, 1} where T <: Array{S} where S
# ^ meta.where-clause.julia meta.generic-name.julia
# ^^ meta.where-clause.julia keyword.operator.subset.julia
# ^^^^^ meta.where-clause.julia meta.parametric-type.julia support.type.julia
# ^ meta.where-clause.julia meta.parametric-type.julia punctuation.section.parameter.begin.julia
# ^ meta.where-clause.julia meta.parametric-type.julia meta.parametric-type.parameters.julia meta.generic-name.julia
# ^ meta.where-clause.julia meta.parametric-type.julia meta.parametric-type.parameters.julia punctuation.section.parameter.end.julia
# ^^^^^ meta.where-clause.julia meta.where-clause.julia keyword.control.julia
# ^ meta.where-clause.julia meta.where-clause.julia meta.generic-name.julia
MyArray{T, S} where {T, S}
# ^ meta.where-clause.julia meta.parametric-type.julia punctuation.section.parameter.begin.julia
# ^ meta.where-clause.julia meta.parametric-type.julia meta.parametric-type.parameters.julia meta.generic-name.julia
# ^ meta.where-clause.julia meta.parametric-type.julia meta.parametric-type.parameters.julia meta.generic-name.julia
MyArray{T, 1} where Int <: T <: Number
# ^^^ meta.where-clause.julia support.type.julia
# ^^ meta.where-clause.julia keyword.operator.subset.julia
# ^ meta.where-clause.julia meta.generic-name.julia
# ^^ meta.where-clause.julia keyword.operator.subset.julia
# ^^^^^^ meta.where-clause.julia support.type.julia
x::Int = 1
# ^ meta.generic-name.julia
# ^^ keyword.operator.colons.julia
# ^^^ support.type.julia
x::Array{S, 2} where S = [2 2; 1 1]
# ^^^^^ meta.parametric-type.julia support.type.julia
# ^^^^^ meta.where-clause.julia keyword.control.julia
# ^ meta.where-clause.julia meta.generic-name.julia
# ^ keyword.operator.assignment.julia
foo(1::Int, abc::Mytype)
# ^^^ meta.function-call.julia variable.function.julia meta.generic-name.julia
# ^^^^^^^^^^^^^^^^^^^^ meta.function-call.julia meta.function-call.arguments.julia
foo(x = 1::Int, y = abc::Mytype)
# ^^^ meta.function-call.julia variable.function.julia meta.generic-name.julia
# ^ meta.function-call.julia meta.function-call.arguments.julia constant.numeric.julia
# ^^^ meta.function-call.julia meta.function-call.arguments.julia meta.generic-name.julia
(foo).(1::Int, abc::Mytype)
# ^ meta.group.julia punctuation.section.group.begin.julia
# ^^^ meta.group.julia meta.function-call.julia variable.function.julia meta.generic-name.julia
# ^ meta.group.julia punctuation.section.group.end.julia
# ^ keyword.operator.broadcast.julia
# ^^^^^^^^^^^^^^^^^^^^^ meta.function-call.julia
foo(x::Int, y::Mytype) = x
# ^^^ meta.function.inline.julia entity.name.function.julia meta.generic-name.julia
# ^^^^^^^^^^^^^^^^^^ meta.function.inline.julia meta.function.parameters.julia
# ^ keyword.operator.assignment.julia
foo(::Int, ::Mytype) = x
# ^^^ meta.function.inline.julia entity.name.function.julia meta.generic-name.julia
# ^^ meta.function.inline.julia meta.function.parameters.julia keyword.operator.colons.julia
foo(::Int = 1, ::Mytype = 1.0) = x
# ^^^ meta.function.inline.julia entity.name.function.julia meta.generic-name.julia
# ^^ meta.function.inline.julia meta.function.parameters.julia keyword.operator.colons.julia
# ^ meta.function.inline.julia meta.function.parameters.julia keyword.operator.assignment.julia
# ^ meta.function.inline.julia meta.function.parameters.julia constant.numeric.julia
# ^ meta.function.inline.julia meta.function.parameters.julia punctuation.separator.arguments.julia
# ^^^^^^ meta.function.inline.julia meta.function.parameters.julia meta.generic-name.julia
# ^ meta.function.inline.julia meta.function.parameters.julia keyword.operator.assignment.julia
(
# <- meta.group
(foo::Int)(x::Int = 1, y::Mytype = 1.0) = x
# ^^^ meta.function.inline.julia meta.generic-name.julia
# ^^^ meta.function.inline.julia support.type.julia
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.inline.julia meta.function.parameters.julia
# ^ meta.function.inline.julia meta.function.parameters.julia constant.numeric.julia
#
# <- meta.group
)
##
## Macros ====
##
@eval hello()
# ^ punctuation.definition.macro.julia
# ^^^^ variable.macro.julia support.function.macro.julia
macro foo(x, y)
# ^^^ meta.macro.julia entity.name.macro.julia meta.generic-name.julia
# ^^^^ meta.macro.julia meta.macro.parameters.julia
end
macro (foo)(x, y)
# ^^^ meta.macro.julia entity.name.macro.julia meta.generic-name.julia
# ^^^^ meta.macro.julia meta.macro.parameters.julia
end
@foo x y
# ^ punctuation.definition.macro.julia
# ^^^ variable.macro.julia meta.generic-name.julia
@foo(x, y)
# ^ punctuation.definition.macro.julia
# ^^^ variable.macro.julia meta.generic-name.julia
@timecustom
#^^^^^^^^^^ -support.function.macro.julia
@time
#^^^^ support.function.macro.julia
##
## Quotes ====
##
quote
foo
# ^^^ meta.quote.julia meta.generic-name.julia
Array
# ^^^^^ meta.quote.julia support.type.julia
Base
# ^^^^ meta.quote.julia support.module.julia
Foo{}
# ^^^^^ meta.quote.julia meta.parametric-type.julia
function $(abc)(x)
# <- - meta.function
# ^^^ meta.interpolation.julia meta.generic-name.julia
# ^ meta.quote.julia meta.generic-name.julia
end
#
# <- meta.quote.julia
end
##
## Symbols ====
##
foo(a = 1, :abc => foo())
# ^^^ meta.function-call.julia variable.function.julia meta.generic-name.julia
# ^^^^ meta.function-call.julia meta.function-call.arguments.julia constant.other.symbol.julia
# ^^ meta.function-call.julia meta.function-call.arguments.julia keyword.operator.pair.julia
:a.b
# ^ keyword.operator
# ^ constant.other.symbol
# ^ meta.generic-name
# (issue 3)
,:βa
# ^ keyword.operator
# ^^ constant.other.symbol
[:+]
# ^ keyword.operator
# ^ constant.other.symbol
(:∘)
# ^ keyword.operator
# ^ constant.other.symbol
:a!
# ^ keyword.operator
# ^^ constant.other.symbol
:(:)
# ^ keyword.operator
# ^ source.julia
# ^ source.julia
:(a)
# ^ keyword.operator
# ^ source.julia
# ^ meta.generic-name
# ^ source.julia
:++a
# ^ keyword.operator
# ^^ constant.other.symbol
# ^ meta.generic-name
:+a
# ^ keyword.operator
# ^ constant.other.symbol
# ^ meta.generic-name
:∘+a # Yes, this is correct, equivalent to +(:∘, a)
# ^ keyword.operator
# ^ constant.other.symbol
# ^ keyword.operator
# ^ meta.generic-name
:.///a
# ^ keyword.operator
# ^^^ constant.other.symbol
# ^ keyword.operator
# ^ meta.generic-name
# (issue 43)
:function
# ^ keyword.operator
# ^^^^^^^^ constant.other.symbol
##
## Chars ====
##
s = '\''
# ^^ meta.string.julia string.quoted.single.julia constant.character.escape.julia
s = 'ab'
# ^^ meta.string.julia string.quoted.single.julia invalid.string.julia
##
## Strings ====
##
s = "\U03b1\U03b2"
# ^^^^^^^^^^^^ meta.string.julia string.quoted.double.julia constant.character.escape.unicode.16-bit-hex.julia
s = "foo + $apple"
# ^ meta.string.julia meta.interpolation.julia keyword.operator.interpolation.julia
# ^^^^^ meta.string.julia meta.interpolation.julia meta.generic-name.julia
s = """
apple
orange
banana
# ^^^^^^^ meta.string.julia string.quoted.double.block.julia
"""
s = "$('\U03b1')\U03b2"
# ^^^^^^^^^^ meta.string.julia meta.interpolation.julia
s = "$(apple + 1)\U03b2"
# ^^^^^^^^^ meta.string.julia meta.interpolation.julia
# ^^^^^^ meta.string.julia string.quoted.double.julia constant.character.escape.unicode.16-bit-hex.julia
r = r"[a-z0-9]{2, 3}"
# ^^^^^^^^^^^^^^ meta.string.julia string.quoted.double.julia source.regexp
r"""
[a-z0-9]{2, 3}"""
# ^^^^^^^^^^^^^^ meta.string.julia string.quoted.double.block.julia source.regexp
r"\""
# ^^ meta.string.julia string.quoted.double.julia source.regexp.python meta.mode.basic.regexp constant.character.escape.regexp
r"""a"b"""
# ^^^ meta.string.julia string.quoted.double.block.julia source.regexp.python meta.mode.basic.regexp
b"DATA\xff\u2200"
# ^^^^ meta.string.julia string.quoted.double.julia constant.character.escape.hex.julia
# ^^^^^^ meta.string.julia string.quoted.double.julia constant.character.escape.unicode.32-bit-hex.julia
b"""DATA\xff\u2200"""
# ^^^^ meta.string.julia string.quoted.double.block.julia constant.character.escape.hex.julia
# ^^^^^^ meta.string.julia string.quoted.double.block.julia constant.character.escape.unicode.32-bit-hex.julia
v"3.0-"
# ^ storage.type.string.julia
raw"abc\"few"
# ^^ meta.string.julia string.quoted.double.julia constant.character.escape.julia
##
## Struct ====
##
Base.@kwdef mutable struct ABC
repo::REPO{} = repo()
# ^^^^ meta.struct.julia meta.generic-name.julia
# ^^^^ meta.struct.julia meta.type.julia meta.parametric-type.julia meta.generic-name.julia
end
##
## List comprehension ====
##
(s for s in S)
# ^^^^^^^^^^^^^ meta.group.julia
# ^^^ meta.group.julia keyword.control.julia
# ^ - meta.group.julia
(s for s in S if s > 0)
# ^^^^^^^^^^^^^^^^^^^^^ meta.group.julia
# ^^^ meta.group.julia keyword.control.julia
# ^^ meta.group.julia keyword.control.julia
# ^ - meta.group.julia
[s for s in S]
# ^^^^^^^^^^^^^ meta.sequence.julia
# ^^^ meta.sequence.julia keyword.control.julia
# ^ - meta.sequence.julia
[s for s in S if s > 0]
# ^^^^^^^^^^^^^^^^^^^^^ meta.sequence.julia
# ^^^ meta.sequence.julia keyword.control.julia
# ^^ meta.sequence.julia keyword.control.julia
#
[x for x in 1:10 if x < 5]
# ^ keyword.operator.colon.julia
# ^^ keyword.control.julia
[x for x in 1:f(10) if x < 5]
# ^ keyword.operator.colon.julia
# ^ meta.function-call.julia variable.function.julia meta.generic-name.julia
# ^^ keyword.control.julia
[x for x in 1:@f(10) if x < 5]
# ^ keyword.operator.colon.julia
# ^^ meta.function-call.macro.julia
# ^^ keyword.control.julia
# Issues
# #98
((x, "x = x"))
# ^^^^^^^^^^^^^^ meta.group.julia
# ^^^^^^^ string.quoted.double.julia
# #99
(I + W1' * W1 / n)
#^^^^^^^^^^^^^^^^^^ meta.group.julia
# ^ keyword.operator.transpose.julia
f(#=x::Int=#; kwargs...)
# ^^^^^^^^^^ comment.block
f(#=x::Int=#; kwargs...) = 1
# <- entity.name.function.julia meta.generic-name.julia
# ^^^^^^^^^^ comment.block
#^ meta.function.inline.julia
# 101
foo(x::A{f(a)}) = 1
# <- meta.function.inline.julia entity.name.function.julia meta.generic-name.julia
# ^^^^ meta.function.inline.julia meta.function.parameters.julia meta.parametric-type.julia meta.parametric-type.parameters.julia meta.function-call.julia