File tree 1 file changed +36
-6
lines changed
1 file changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,14 @@ var GmqlHighlightRules = function() {
81
81
"start" : [ {
82
82
token : "comment" ,
83
83
regex : "#.*$"
84
- } , {
85
- token : "string" , // " string
86
- regex : '".*?"'
87
84
} , {
88
- token : "string" , // ' string
89
- regex : "'.*?'"
85
+ token : "string" ,
86
+ regex : "'(?=.)" ,
87
+ next : "qstring"
88
+ } , {
89
+ token : "string" ,
90
+ regex : '"(?=.)' ,
91
+ next : "qqstring"
90
92
} , {
91
93
token : "constant.numeric" , // float
92
94
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
@@ -105,7 +107,35 @@ var GmqlHighlightRules = function() {
105
107
} , {
106
108
token : "text" ,
107
109
regex : "\\s+"
108
- } ]
110
+ } ] ,
111
+ "qqstring" : [ {
112
+ token : "constant.language.escape" ,
113
+ regex : escapedRe
114
+ } , {
115
+ token : "string" ,
116
+ regex : "\\\\$" ,
117
+ next : "qqstring"
118
+ } , {
119
+ token : "string" ,
120
+ regex : '"|$' ,
121
+ next : "no_regex"
122
+ } , {
123
+ defaultToken : "string"
124
+ } ] ,
125
+ "qstring" : [ {
126
+ token : "constant.language.escape" ,
127
+ regex : escapedRe
128
+ } , {
129
+ token : "string" ,
130
+ regex : "\\\\$" ,
131
+ next : "qstring"
132
+ } , {
133
+ token : "string" ,
134
+ regex : "'|$" ,
135
+ next : "no_regex"
136
+ } , {
137
+ defaultToken : "string"
138
+ } ]
109
139
} ;
110
140
this . normalizeRules ( ) ;
111
141
} ;
You can’t perform that action at this time.
0 commit comments