bobe 0.0.62 → 0.0.64
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/dist/bobe.cjs.js +16 -16
- package/dist/bobe.cjs.js.map +1 -1
- package/dist/bobe.compiler.cjs.js +16 -16
- package/dist/bobe.compiler.cjs.js.map +1 -1
- package/dist/bobe.compiler.esm.js +16 -16
- package/dist/bobe.compiler.esm.js.map +1 -1
- package/dist/bobe.esm.js +16 -16
- package/dist/bobe.esm.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.umd.js +16 -16
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/bobe.esm.js
CHANGED
|
@@ -1649,11 +1649,11 @@ class Interpreter {
|
|
|
1649
1649
|
if (value === 'if' || value === 'else' || value === 'fail') {
|
|
1650
1650
|
return this.condDeclaration(ctx);
|
|
1651
1651
|
} else if (value === 'context') {
|
|
1652
|
-
_node = this.createContextNode();
|
|
1652
|
+
_node = this.createContextNode(ctx);
|
|
1653
1653
|
} else if (value === 'tp') {
|
|
1654
|
-
return this.createTpNode();
|
|
1654
|
+
return this.createTpNode(ctx);
|
|
1655
1655
|
} else if (value === 'for') {
|
|
1656
|
-
return this.forDeclaration();
|
|
1656
|
+
return this.forDeclaration(ctx);
|
|
1657
1657
|
} else if (hookType) {
|
|
1658
1658
|
const data = this.getData();
|
|
1659
1659
|
if (hookType === 'static') {
|
|
@@ -1686,7 +1686,7 @@ class Interpreter {
|
|
|
1686
1686
|
const valueIsMapKey = Boolean(getProxyHasKey(pData, value));
|
|
1687
1687
|
let node = {
|
|
1688
1688
|
__logicType: null,
|
|
1689
|
-
realParent:
|
|
1689
|
+
realParent: ctx.realParent,
|
|
1690
1690
|
tokenizer: null,
|
|
1691
1691
|
effect: null,
|
|
1692
1692
|
textNode: null,
|
|
@@ -1772,12 +1772,12 @@ class Interpreter {
|
|
|
1772
1772
|
});
|
|
1773
1773
|
return node;
|
|
1774
1774
|
}
|
|
1775
|
-
createTpNode() {
|
|
1775
|
+
createTpNode(ctx) {
|
|
1776
1776
|
const child = deepSignal({}, getPulling());
|
|
1777
1777
|
const node = {
|
|
1778
1778
|
__logicType: FakeType.Tp,
|
|
1779
1779
|
data: this.getData(),
|
|
1780
|
-
realParent:
|
|
1780
|
+
realParent: ctx.realParent,
|
|
1781
1781
|
realBefore: null,
|
|
1782
1782
|
realAfter: null,
|
|
1783
1783
|
contentBefore: null,
|
|
@@ -1785,7 +1785,7 @@ class Interpreter {
|
|
|
1785
1785
|
effect: null,
|
|
1786
1786
|
snapshot: null,
|
|
1787
1787
|
tpData: child,
|
|
1788
|
-
owner:
|
|
1788
|
+
owner: ctx.stack.peekByType(NodeSort.TokenizerSwitcher)?.node
|
|
1789
1789
|
};
|
|
1790
1790
|
this.onePropParsed = createStoreOnePropParsed(child);
|
|
1791
1791
|
this.tokenizer.nextToken();
|
|
@@ -1875,9 +1875,9 @@ class Interpreter {
|
|
|
1875
1875
|
});
|
|
1876
1876
|
return node;
|
|
1877
1877
|
}
|
|
1878
|
-
createContextNode() {
|
|
1878
|
+
createContextNode(ctx) {
|
|
1879
1879
|
const child = deepSignal({}, getPulling());
|
|
1880
|
-
const parentContext =
|
|
1880
|
+
const parentContext = ctx.stack.peekByType(NodeSort.Context)?.node?.context;
|
|
1881
1881
|
if (parentContext) {
|
|
1882
1882
|
backupSignal(child, parentContext);
|
|
1883
1883
|
}
|
|
@@ -1885,7 +1885,7 @@ class Interpreter {
|
|
|
1885
1885
|
const node = {
|
|
1886
1886
|
__logicType: FakeType.Context,
|
|
1887
1887
|
context: child,
|
|
1888
|
-
realParent:
|
|
1888
|
+
realParent: ctx.realParent,
|
|
1889
1889
|
realBefore: null,
|
|
1890
1890
|
realAfter: null
|
|
1891
1891
|
};
|
|
@@ -1930,7 +1930,7 @@ class Interpreter {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
return res;
|
|
1932
1932
|
}
|
|
1933
|
-
forDeclaration() {
|
|
1933
|
+
forDeclaration(ctx) {
|
|
1934
1934
|
const arrExp = this.tokenizer.jsExp().value;
|
|
1935
1935
|
this.tokenizer.nextToken();
|
|
1936
1936
|
const itemToken = this.tokenizer.nextToken();
|
|
@@ -1956,12 +1956,12 @@ class Interpreter {
|
|
|
1956
1956
|
if (this.tokenizer.peekChar() !== '\n') keyExp = this.tokenizer.jsExp().value;
|
|
1957
1957
|
}
|
|
1958
1958
|
}
|
|
1959
|
-
const owner =
|
|
1960
|
-
const prevSibling =
|
|
1959
|
+
const owner = ctx.stack.peekByType(NodeSort.TokenizerSwitcher)?.node;
|
|
1960
|
+
const prevSibling = ctx.prevSibling;
|
|
1961
1961
|
const forNode = {
|
|
1962
1962
|
__logicType: FakeType.For,
|
|
1963
1963
|
snapshot: this.tokenizer.snapshot(['dentStack', 'isFirstToken']),
|
|
1964
|
-
realParent:
|
|
1964
|
+
realParent: ctx.realParent,
|
|
1965
1965
|
prevSibling,
|
|
1966
1966
|
realBefore: prevSibling?.realAfter || prevSibling,
|
|
1967
1967
|
realAfter: null,
|
|
@@ -2225,7 +2225,7 @@ class Interpreter {
|
|
|
2225
2225
|
forItemNode = {
|
|
2226
2226
|
id: this.forItemId++,
|
|
2227
2227
|
__logicType: FakeType.ForItem,
|
|
2228
|
-
realParent:
|
|
2228
|
+
realParent: this.ctx.realParent,
|
|
2229
2229
|
realBefore: null,
|
|
2230
2230
|
realAfter: null,
|
|
2231
2231
|
forNode,
|
|
@@ -2377,7 +2377,7 @@ class Interpreter {
|
|
|
2377
2377
|
const ifNode = {
|
|
2378
2378
|
__logicType: isElse ? FakeType.Else : isIf ? FakeType.If : FakeType.Fail,
|
|
2379
2379
|
snapshot: this.tokenizer.snapshot(),
|
|
2380
|
-
realParent:
|
|
2380
|
+
realParent: ctx.realParent,
|
|
2381
2381
|
realBefore: null,
|
|
2382
2382
|
realAfter: null,
|
|
2383
2383
|
condition: null,
|