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