@iebh/polyglot 4.9.1 → 4.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/modules/parse.js +14 -11
- package/package.json +1 -1
package/lib/modules/parse.js
CHANGED
|
@@ -179,17 +179,6 @@ var parse = function parse(query, options) {
|
|
|
179
179
|
});
|
|
180
180
|
offset += match[1].length;
|
|
181
181
|
q = q.substr(match[1].length);
|
|
182
|
-
} else if (match = /(\$1)\b/i.exec(q)) {
|
|
183
|
-
// $1
|
|
184
|
-
branch.nodes.push({
|
|
185
|
-
type: 'dollarOne',
|
|
186
|
-
ref: [match[2]],
|
|
187
|
-
cond: match[2] ? match[2].toUpperCase() : '',
|
|
188
|
-
nodes: []
|
|
189
|
-
});
|
|
190
|
-
offset += match[0].length;
|
|
191
|
-
q = q.substr(match[0].length);
|
|
192
|
-
cropString = false;
|
|
193
182
|
} else if (/^\(/.test(q)) {
|
|
194
183
|
var newGroup = {
|
|
195
184
|
type: 'group',
|
|
@@ -586,6 +575,20 @@ var parse = function parse(query, options) {
|
|
|
586
575
|
offset += match[0].length;
|
|
587
576
|
q = q.substr(match[0].length);
|
|
588
577
|
cropString = false;
|
|
578
|
+
} else if (match = /(\$1)\b/i.exec(q)) {
|
|
579
|
+
// $1
|
|
580
|
+
branch.nodes.push({
|
|
581
|
+
type: 'dollarOne',
|
|
582
|
+
ref: [match[2]],
|
|
583
|
+
cond: match[2] ? match[2].toUpperCase() : '',
|
|
584
|
+
nodes: []
|
|
585
|
+
});
|
|
586
|
+
var index = q.indexOf(match[0]);
|
|
587
|
+
if (index !== -1) {
|
|
588
|
+
offset += index + 2;
|
|
589
|
+
q = q.slice(0, index) + q.slice(index + 2);
|
|
590
|
+
cropString = false;
|
|
591
|
+
}
|
|
589
592
|
}
|
|
590
593
|
// }}}
|
|
591
594
|
else {
|