Skip to content

Commit 238f7f9

Browse files
committed
updated gmql string literals
1 parent 43d6a1b commit 238f7f9

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

lib/ace/mode/gmql_highlight_rules.js

+36-6
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ var GmqlHighlightRules = function() {
8181
"start" : [ {
8282
token : "comment",
8383
regex : "#.*$"
84-
}, {
85-
token : "string", // " string
86-
regex : '".*?"'
8784
}, {
88-
token : "string", // ' string
89-
regex : "'.*?'"
85+
token : "string",
86+
regex : "'(?=.)",
87+
next : "qstring"
88+
}, {
89+
token : "string",
90+
regex : '"(?=.)',
91+
next : "qqstring"
9092
}, {
9193
token : "constant.numeric", // float
9294
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
@@ -105,7 +107,35 @@ var GmqlHighlightRules = function() {
105107
}, {
106108
token : "text",
107109
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+
}]
109139
};
110140
this.normalizeRules();
111141
};

0 commit comments

Comments
 (0)