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 = {
263263 {
264264 include : '#singleton-type'
265265 } ,
266+ {
267+ include : '#inline'
268+ } ,
266269 {
267270 include : '#scala-quoted'
268271 } ,
@@ -571,6 +574,26 @@ export const scalaTmLanguage: TmLanguage = {
571574 }
572575 }
573576 } ,
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+ } ,
574597 'scala-quoted' : {
575598 match : "('\\{|'\\[)(?!')" ,
576599 name : 'constant.other.quoted.scala'
@@ -822,7 +845,7 @@ export const scalaTmLanguage: TmLanguage = {
822845 name : 'storage.modifier.access'
823846 } ,
824847 {
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' ,
826849 name : 'storage.modifier.other'
827850 }
828851 ]
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