File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,9 @@ export const scalaTmLanguage: TmLanguage = {
263
263
{
264
264
include : '#singleton-type'
265
265
} ,
266
+ {
267
+ include : '#inline'
268
+ } ,
266
269
{
267
270
include : '#scala-quoted'
268
271
} ,
@@ -571,6 +574,26 @@ export const scalaTmLanguage: TmLanguage = {
571
574
}
572
575
}
573
576
} ,
577
+ inline : {
578
+ patterns : [
579
+ {
580
+ match : `\\b(inline)\\b(?=(\\s+${ plainid } \\s*:)|(.*(val|def)))` ,
581
+ captures : {
582
+ '1' : {
583
+ name : 'storage.modifier.other'
584
+ }
585
+ }
586
+ } ,
587
+ {
588
+ match : `\\b(inline)\\b(?=.*(if|match))` ,
589
+ captures : {
590
+ '1' : {
591
+ name : 'keyword.control.flow.scala'
592
+ }
593
+ }
594
+ }
595
+ ]
596
+ } ,
574
597
'scala-quoted' : {
575
598
match : "('\\{|'\\[)(?!')" ,
576
599
name : 'constant.other.quoted.scala'
@@ -822,7 +845,7 @@ export const scalaTmLanguage: TmLanguage = {
822
845
name : 'storage.modifier.access'
823
846
} ,
824
847
{
825
- match : '\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|inline | opaque |override|@transient|@native)\\b' ,
848
+ match : '\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|opaque |override|@transient|@native)\\b' ,
826
849
name : 'storage.modifier.other'
827
850
}
828
851
]
Original file line number Diff line number Diff line change
1
+ // SYNTAX TEST "source.scala"
2
+
3
+
4
+ inline val c = 0
5
+ // ^^^^^^ storage.modifier.other
6
+
7
+ inline def power (x : Double , inline n : Int ): Double =
8
+ // ^^^^^^ storage.modifier.other
9
+ // ^^^^^^ storage.modifier.other
10
+ inline if (n == 0 ) 1.0
11
+ // ^^^^^^ keyword.control.flow.scala
12
+ else inline if (n % 2 == 1 ) x * power(x, n - 1 )
13
+ // ^^^^^^ keyword.control.flow.scala
14
+ else power(x * x, n / 2 )
15
+
16
+
17
+ inline x match {
18
+ // ^^^^^^ keyword.control.flow.scala
19
+ // ^^^^^ keyword.control.flow.scala
You can’t perform that action at this time.
0 commit comments