@cilix/lightjs 0.0.20 → 0.0.21
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/core.js +9 -8
- package/package.json +1 -1
package/core.js
CHANGED
|
@@ -439,7 +439,12 @@ module.exports = (config, fs, path) => {
|
|
|
439
439
|
let in_expr = false;
|
|
440
440
|
let pos = cursor;
|
|
441
441
|
while (i < max) {
|
|
442
|
-
if (text[i] === "{" && text[i+1] === "{" && in_expr === false
|
|
442
|
+
if (text[i] === "{" && text[i+1] === "{" && in_expr === false) {
|
|
443
|
+
if (text[i-1] === '\\') {
|
|
444
|
+
chunk = chunk.slice(0, -1);
|
|
445
|
+
chunk += text[i++];
|
|
446
|
+
continue;
|
|
447
|
+
}
|
|
443
448
|
in_expr = true;
|
|
444
449
|
chunks.push({ type: "chunk", data: chunk, pos: pos, file: file });
|
|
445
450
|
chunk = "{{";
|
|
@@ -635,13 +640,9 @@ module.exports = (config, fs, path) => {
|
|
|
635
640
|
* bad (incorrect token position) due to newline magic above */
|
|
636
641
|
tokens.push({ type: 'string', pos: offs + cursor, file: file });
|
|
637
642
|
let chunks = break_into_chunks(text, cursor);
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
});
|
|
642
|
-
} else {
|
|
643
|
-
tokens.push({ type: 'chunk', data: text, pos: offs + cursor, file: file })
|
|
644
|
-
}
|
|
643
|
+
chunks.forEach(function(c) {
|
|
644
|
+
tokens.push(c);
|
|
645
|
+
});
|
|
645
646
|
/*
|
|
646
647
|
tokens.push({ type: 'string', pos: offs + cursor, file: file });
|
|
647
648
|
tokens.push({ type: 'chunk', data: text, pos: offs + cursor, file: file })
|