bobe 0.0.34 → 0.0.35
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 +30 -22
- package/dist/bobe.cjs.js.map +1 -1
- package/dist/bobe.compiler.cjs.js +30 -22
- package/dist/bobe.compiler.cjs.js.map +1 -1
- package/dist/bobe.compiler.esm.js +30 -22
- package/dist/bobe.compiler.esm.js.map +1 -1
- package/dist/bobe.esm.js +30 -22
- package/dist/bobe.esm.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.umd.js +30 -22
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/bobe.esm.js
CHANGED
|
@@ -598,24 +598,6 @@ class Tokenizer {
|
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
600
|
|
|
601
|
-
var NodeType = function (NodeType) {
|
|
602
|
-
NodeType["Element"] = "Element";
|
|
603
|
-
NodeType["Text"] = "Text";
|
|
604
|
-
NodeType["Interpolation"] = "Interpolation";
|
|
605
|
-
NodeType["Property"] = "Property";
|
|
606
|
-
NodeType["PropertyKey"] = "PropertyKey";
|
|
607
|
-
NodeType["StaticValue"] = "StaticValue";
|
|
608
|
-
NodeType["DynamicValue"] = "DynamicValue";
|
|
609
|
-
NodeType["Program"] = "Program";
|
|
610
|
-
NodeType["If"] = "If";
|
|
611
|
-
NodeType["Else"] = "Else";
|
|
612
|
-
NodeType["Fail"] = "Fail";
|
|
613
|
-
NodeType["For"] = "For";
|
|
614
|
-
NodeType["Component"] = "Component";
|
|
615
|
-
NodeType["Fragment"] = "Fragment";
|
|
616
|
-
return NodeType;
|
|
617
|
-
}(NodeType || {});
|
|
618
|
-
|
|
619
601
|
function _applyDecs2311(e, t, n, r, o, i) {
|
|
620
602
|
var a,
|
|
621
603
|
c,
|
|
@@ -832,10 +814,28 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
832
814
|
}
|
|
833
815
|
}
|
|
834
816
|
|
|
817
|
+
var NodeType = function (NodeType) {
|
|
818
|
+
NodeType["Element"] = "Element";
|
|
819
|
+
NodeType["Text"] = "Text";
|
|
820
|
+
NodeType["Interpolation"] = "Interpolation";
|
|
821
|
+
NodeType["Property"] = "Property";
|
|
822
|
+
NodeType["PropertyKey"] = "PropertyKey";
|
|
823
|
+
NodeType["StaticValue"] = "StaticValue";
|
|
824
|
+
NodeType["DynamicValue"] = "DynamicValue";
|
|
825
|
+
NodeType["Program"] = "Program";
|
|
826
|
+
NodeType["If"] = "If";
|
|
827
|
+
NodeType["Else"] = "Else";
|
|
828
|
+
NodeType["Fail"] = "Fail";
|
|
829
|
+
NodeType["For"] = "For";
|
|
830
|
+
NodeType["Component"] = "Component";
|
|
831
|
+
NodeType["Fragment"] = "Fragment";
|
|
832
|
+
return NodeType;
|
|
833
|
+
}(NodeType || {});
|
|
834
|
+
|
|
835
835
|
let _initProto;
|
|
836
836
|
class Compiler {
|
|
837
837
|
static {
|
|
838
|
-
var _applyDecs$e = _slicedToArray(_applyDecs2311(this, [], [[NodeHook, 2, "parseProgram"], [[NodeHook, NodeLoc], 2, "parseComponentNode"], [[NodeHook, NodeLoc], 2, "parseElementNode"], [[NodeHook, NodeLoc], 2, "parseConditionalNode"], [[NodeHook, NodeLoc], 2, "parseLoopNode"], [NodeHook, 2, "parseProperty"], [[NodeHook, TokenLoc], 2, "parsePropertyKey"], [[NodeHook, TokenLoc], 2, "parsePropertyValue"]]).e, 1);
|
|
838
|
+
var _applyDecs$e = _slicedToArray(_applyDecs2311(this, [], [[NodeHook, 2, "parseProgram"], [[NodeHook, NodeLoc], 2, "parseComponentNode"], [[NodeHook, NodeLoc], 2, "parseElementNode"], [[NodeHook, NodeLoc], 2, "parseConditionalNode"], [[NodeHook, NodeLoc], 2, "parseLoopNode"], [NodeHook, 2, "parseProperty"], [[NodeHook, TokenLoc], 2, "parsePropertyKey"], [[NodeHook, TokenLoc], 2, "parsePropertyValue"], [[NodeHook, TokenLoc], 2, "parseName"]]).e, 1);
|
|
839
839
|
_initProto = _applyDecs$e[0];
|
|
840
840
|
}
|
|
841
841
|
constructor(tokenizer, hooks = {}) {
|
|
@@ -904,12 +904,11 @@ class Compiler {
|
|
|
904
904
|
return this.parseElementNode();
|
|
905
905
|
}
|
|
906
906
|
parseComponentNode(node) {
|
|
907
|
-
const
|
|
908
|
-
const tagName = tagToken.value;
|
|
907
|
+
const name = this.parseName();
|
|
909
908
|
this.tokenizer.nextToken();
|
|
910
909
|
const props = this.headerLineAndExtensions();
|
|
911
910
|
node.type = NodeType.Component;
|
|
912
|
-
node.componentName =
|
|
911
|
+
node.componentName = name;
|
|
913
912
|
node.props = props;
|
|
914
913
|
this.hooks.parseComponentNode?.propsAdded?.call(this, node);
|
|
915
914
|
const children = this.handleChildren();
|
|
@@ -1034,6 +1033,15 @@ class Compiler {
|
|
|
1034
1033
|
node.value = value;
|
|
1035
1034
|
return node;
|
|
1036
1035
|
}
|
|
1036
|
+
parseName(node) {
|
|
1037
|
+
const _this$tokenizer$_hook5 = this.tokenizer._hook({}),
|
|
1038
|
+
_this$tokenizer$_hook6 = _slicedToArray(_this$tokenizer$_hook5, 2),
|
|
1039
|
+
hookType = _this$tokenizer$_hook6[0],
|
|
1040
|
+
value = _this$tokenizer$_hook6[1];
|
|
1041
|
+
node.type = hookType === 'dynamic' ? NodeType.DynamicValue : NodeType.StaticValue;
|
|
1042
|
+
node.value = value;
|
|
1043
|
+
return node;
|
|
1044
|
+
}
|
|
1037
1045
|
}
|
|
1038
1046
|
function NodeLoc(target, context) {
|
|
1039
1047
|
return function (_node) {
|