@iebh/polyglot 4.8.2 → 4.8.4
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.
|
@@ -319,9 +319,12 @@ var _default = {
|
|
|
319
319
|
buffer += 'NOT';
|
|
320
320
|
break;
|
|
321
321
|
case 'raw':
|
|
322
|
+
console.log("Here1", buffer);
|
|
322
323
|
buffer += branch.content;
|
|
323
324
|
break;
|
|
325
|
+
case 'dollarOne':
|
|
324
326
|
case 'template':
|
|
327
|
+
console.log("Here2", buffer);
|
|
325
328
|
buffer += _tools["default"].resolveTemplate(branch.content, engine);
|
|
326
329
|
break;
|
|
327
330
|
case 'comment':
|
package/lib/modules/parse.js
CHANGED
|
@@ -138,7 +138,23 @@ var parse = function parse(query, options) {
|
|
|
138
138
|
while (q.length) {
|
|
139
139
|
var cropString = true; // Whether to remove one charcater from the beginning of the string (set to false if the lexical match handles this behaviour itself)
|
|
140
140
|
var match;
|
|
141
|
-
if (
|
|
141
|
+
if (match = /^\$1\b/.exec(q)) {
|
|
142
|
+
// $1
|
|
143
|
+
branch.nodes.push({
|
|
144
|
+
type: 'dollarOne'
|
|
145
|
+
});
|
|
146
|
+
offset += match[0].length;
|
|
147
|
+
q = q.substr(match[0].length);
|
|
148
|
+
cropString = false;
|
|
149
|
+
} else if (match = /^\$[2-9]\b/.exec(q)) {
|
|
150
|
+
// $2 to $9
|
|
151
|
+
branch.nodes.push({
|
|
152
|
+
type: 'dollarOtherNum'
|
|
153
|
+
});
|
|
154
|
+
offset += match[0].length;
|
|
155
|
+
q = q.substr(match[0].length);
|
|
156
|
+
cropString = false;
|
|
157
|
+
} else if (/^\(/.test(q)) {
|
|
142
158
|
var newGroup = {
|
|
143
159
|
type: 'group',
|
|
144
160
|
nodes: []
|