File tree 2 files changed +55
-26
lines changed
2 files changed +55
-26
lines changed Original file line number Diff line number Diff line change @@ -883,37 +883,53 @@ export const scalaTmLanguage: TmLanguage = {
883
883
]
884
884
} ,
885
885
'char-literal' : {
886
- end : "'|$" ,
887
- begin : "'" ,
888
- beginCaptures : {
889
- '0' : {
890
- name : 'punctuation.definition.character.begin.scala'
891
- }
892
- } ,
893
886
patterns : [
894
887
{
895
- match : `\\\\(?:[btnfr\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})` ,
896
- name : 'constant.character.escape .scala'
897
- } ,
898
- {
899
- match : '\\\\.' ,
900
- name : 'invalid.illegal.unrecognized-character-escape.scala'
901
- } ,
902
- {
903
- match : "[^']{2,}" ,
904
- name : 'invalid.illegal.character-literal-too-long'
888
+ match : "(')'(')" ,
889
+ name : 'string.quoted.other constant.character.literal .scala' ,
890
+ captures : {
891
+ '1' : {
892
+ name : 'punctuation.definition.character.begin.scala'
893
+ } ,
894
+ '2' : {
895
+ name : 'punctuation.definition.character.end.scala'
896
+ }
897
+ }
905
898
} ,
906
899
{
907
- match : "(?<!')[^']" ,
908
- name : 'invalid.illegal.character-literal-too-long'
909
- }
910
- ] ,
911
- endCaptures : {
912
- '0' : {
913
- name : 'punctuation.definition.character.end.scala'
900
+ end : "'|$" ,
901
+ begin : "'" ,
902
+ beginCaptures : {
903
+ '0' : {
904
+ name : 'punctuation.definition.character.begin.scala'
905
+ }
906
+ } ,
907
+ patterns : [
908
+ {
909
+ match : `\\\\(?:[btnfr\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})` ,
910
+ name : 'constant.character.escape.scala'
911
+ } ,
912
+ {
913
+ match : '\\\\.' ,
914
+ name : 'invalid.illegal.unrecognized-character-escape.scala'
915
+ } ,
916
+ {
917
+ match : "[^']{2,}" ,
918
+ name : 'invalid.illegal.character-literal-too-long'
919
+ } ,
920
+ {
921
+ match : "(?<!')[^']" ,
922
+ name : 'invalid.illegal.character-literal-too-long'
923
+ } ,
924
+ ] ,
925
+ endCaptures : {
926
+ '0' : {
927
+ name : 'punctuation.definition.character.end.scala'
928
+ }
929
+ } ,
930
+ name : 'string.quoted.other constant.character.literal.scala'
914
931
}
915
- } ,
916
- name : 'string.quoted.other constant.character.literal.scala'
932
+ ]
917
933
} ,
918
934
initialization : {
919
935
match : '\\b(new)\\b' ,
Original file line number Diff line number Diff line change
1
+ // SYNTAX TEST "source.scala"
2
+
3
+ val x = ''' + '"'
4
+ // ^^^ constant.character.literal.scala
5
+ // ^ punctuation.definition.character.begin.scala
6
+ // ^ punctuation.definition.character.end.scala
7
+ // ^ keyword.operator.arithmetic.scala
8
+
9
+ val x = '''' + ' " '
10
+ // ^^^^ constant.character.literal.scala
11
+ // ^ punctuation.definition.character.begin.scala
12
+ // ^ punctuation.definition.character.end.scala
13
+ // ^ punctuation.definition.character.begin.scala
You can’t perform that action at this time.
0 commit comments