malinajs 0.7.2-a6 → 0.7.2-a7
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/malina.js +34 -21
- package/package.json +1 -1
package/malina.js
CHANGED
|
@@ -1351,27 +1351,40 @@
|
|
|
1351
1351
|
if(r.probe('/>') || r.probe('>')) break;
|
|
1352
1352
|
} else if(r.end()) break;
|
|
1353
1353
|
let start = r.index;
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1354
|
+
if(r.probe('{*')) {
|
|
1355
|
+
const {raw} = parseBinding(r);
|
|
1356
|
+
result.push({name: raw, content: raw});
|
|
1357
|
+
} else if(r.probe('*{')) {
|
|
1358
|
+
r.read();
|
|
1359
|
+
let {raw} = parseBinding(r);
|
|
1360
|
+
raw = '*' + raw;
|
|
1361
|
+
result.push({name: raw, content: raw});
|
|
1362
|
+
} else if(r.probe('{...')) {
|
|
1363
|
+
let {raw} = parseBinding(r);
|
|
1364
|
+
result.push({name: raw, content: raw});
|
|
1365
|
+
} else {
|
|
1366
|
+
let name = r.readAttribute();
|
|
1367
|
+
assert(name, 'Wrong syntax');
|
|
1368
|
+
if(r.readIf('=')) {
|
|
1369
|
+
if(r.probe('{')) {
|
|
1370
|
+
const {raw} = parseBinding(r);
|
|
1371
|
+
result.push({name, value: raw, raw, content: r.sub(start)});
|
|
1372
|
+
} else if(r.probeQuote()) {
|
|
1373
|
+
const raw = r.readString();
|
|
1374
|
+
const value = raw.substring(1, raw.length - 1);
|
|
1375
|
+
result.push({name, value, raw, content: r.sub(start)});
|
|
1376
|
+
} else {
|
|
1377
|
+
const value = r.readIf(/^\S+/);
|
|
1378
|
+
result.push({name, value, raw: value, content: r.sub(start)});
|
|
1379
|
+
}
|
|
1364
1380
|
} else {
|
|
1365
|
-
|
|
1381
|
+
let value;
|
|
1382
|
+
if(name[0] == '{' && last(name) == '}' && !name.startsWith('{...')) {
|
|
1383
|
+
value = name;
|
|
1384
|
+
name = unwrapExp(name);
|
|
1385
|
+
}
|
|
1366
1386
|
result.push({name, value, raw: value, content: r.sub(start)});
|
|
1367
1387
|
}
|
|
1368
|
-
} else {
|
|
1369
|
-
let value;
|
|
1370
|
-
if(name[0] == '{' && last(name) == '}' && !name.startsWith('{...')) {
|
|
1371
|
-
value = name;
|
|
1372
|
-
name = unwrapExp(name);
|
|
1373
|
-
}
|
|
1374
|
-
result.push({name, value, raw: value, content: r.sub(start)});
|
|
1375
1388
|
}
|
|
1376
1389
|
}
|
|
1377
1390
|
|
|
@@ -2306,7 +2319,7 @@
|
|
|
2306
2319
|
go(n, false, el);
|
|
2307
2320
|
}
|
|
2308
2321
|
} else if(n.type === 'block') {
|
|
2309
|
-
if(n.name == 'keep
|
|
2322
|
+
if(n.name == 'keep') {
|
|
2310
2323
|
if(isRoot) requireFragment = true;
|
|
2311
2324
|
binds.push(xNode('attach-fragment', {
|
|
2312
2325
|
label: requireLabel(),
|
|
@@ -6712,7 +6725,7 @@
|
|
|
6712
6725
|
}
|
|
6713
6726
|
|
|
6714
6727
|
let key = null;
|
|
6715
|
-
let args = node.value.substr(
|
|
6728
|
+
let args = node.value.substr(6);
|
|
6716
6729
|
if(args) {
|
|
6717
6730
|
args = parseAttibutes(args);
|
|
6718
6731
|
const a = args.find(a => a.name == 'key');
|
|
@@ -6737,7 +6750,7 @@
|
|
|
6737
6750
|
});
|
|
6738
6751
|
}
|
|
6739
6752
|
|
|
6740
|
-
const version = '0.7.2-
|
|
6753
|
+
const version = '0.7.2-a7';
|
|
6741
6754
|
|
|
6742
6755
|
|
|
6743
6756
|
async function compile(source, config = {}) {
|