vsn 0.1.148 → 1.0.0
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/README.md +7 -6
- package/dist/index.cjs +5011 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +630 -0
- package/dist/index.d.ts +630 -0
- package/dist/index.js +4942 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +9 -0
- package/dist/index.min.js.map +1 -0
- package/package.json +30 -48
- package/.gitattributes +0 -2
- package/.travis.yml +0 -28
- package/demo/demo.html +0 -237
- package/demo/examples/cascading-function-sheets.html +0 -39
- package/demo/examples/component-slots.html +0 -29
- package/demo/examples/events.html +0 -21
- package/demo/examples/item-filtering.html +0 -45
- package/demo/examples/loop.html +0 -21
- package/demo/examples/persist.html +0 -17
- package/demo/examples/replace-html.html +0 -19
- package/demo/markup-default.html +0 -2
- package/demo/markup.html +0 -2
- package/demo/memory-leak-test.html +0 -82
- package/demo/named-stack.html +0 -34
- package/demo/resources/xhr-animations.html +0 -24
- package/demo/resources/xhr-cfs.html +0 -1
- package/demo/resources/xhr-html.html +0 -1
- package/demo/resources/xhr-lazy.html +0 -60
- package/demo/resources/xhr-memory-leak-test.html +0 -14
- package/demo/resources/xhr-persist.html +0 -40
- package/demo/resources/xhr-test-component.html +0 -4
- package/demo/service.html +0 -22
- package/demo/silly-animations.html +0 -27
- package/demo/vsn.js +0 -3
- package/demo/xhr-response.html +0 -1
- package/demo/xhr-test.html +0 -32
- package/dist/AST/ArithmeticNode.d.ts +0 -15
- package/dist/AST/ArithmeticNode.js +0 -114
- package/dist/AST/ArithmeticNode.js.map +0 -1
- package/dist/AST/ArrayNode.d.ts +0 -14
- package/dist/AST/ArrayNode.js +0 -166
- package/dist/AST/ArrayNode.js.map +0 -1
- package/dist/AST/AsNode.d.ts +0 -13
- package/dist/AST/AsNode.js +0 -92
- package/dist/AST/AsNode.js.map +0 -1
- package/dist/AST/AssignmentNode.d.ts +0 -24
- package/dist/AST/AssignmentNode.js +0 -392
- package/dist/AST/AssignmentNode.js.map +0 -1
- package/dist/AST/BlockNode.d.ts +0 -11
- package/dist/AST/BlockNode.js +0 -114
- package/dist/AST/BlockNode.js.map +0 -1
- package/dist/AST/BooleanLiteralNode.d.ts +0 -5
- package/dist/AST/BooleanLiteralNode.js +0 -31
- package/dist/AST/BooleanLiteralNode.js.map +0 -1
- package/dist/AST/ClassNode.d.ts +0 -47
- package/dist/AST/ClassNode.js +0 -593
- package/dist/AST/ClassNode.js.map +0 -1
- package/dist/AST/ComparisonNode.d.ts +0 -15
- package/dist/AST/ComparisonNode.js +0 -120
- package/dist/AST/ComparisonNode.js.map +0 -1
- package/dist/AST/ConditionalNode.d.ts +0 -13
- package/dist/AST/ConditionalNode.js +0 -95
- package/dist/AST/ConditionalNode.js.map +0 -1
- package/dist/AST/DispatchEventNode.d.ts +0 -17
- package/dist/AST/DispatchEventNode.js +0 -152
- package/dist/AST/DispatchEventNode.js.map +0 -1
- package/dist/AST/ElementAttributeNode.d.ts +0 -20
- package/dist/AST/ElementAttributeNode.js +0 -242
- package/dist/AST/ElementAttributeNode.js.map +0 -1
- package/dist/AST/ElementQueryNode.d.ts +0 -17
- package/dist/AST/ElementQueryNode.js +0 -148
- package/dist/AST/ElementQueryNode.js.map +0 -1
- package/dist/AST/ElementStyleNode.d.ts +0 -20
- package/dist/AST/ElementStyleNode.js +0 -205
- package/dist/AST/ElementStyleNode.js.map +0 -1
- package/dist/AST/ForStatementNode.d.ts +0 -17
- package/dist/AST/ForStatementNode.js +0 -121
- package/dist/AST/ForStatementNode.js.map +0 -1
- package/dist/AST/FunctionArgumentNode.d.ts +0 -11
- package/dist/AST/FunctionArgumentNode.js +0 -142
- package/dist/AST/FunctionArgumentNode.js.map +0 -1
- package/dist/AST/FunctionCallNode.d.ts +0 -14
- package/dist/AST/FunctionCallNode.js +0 -241
- package/dist/AST/FunctionCallNode.js.map +0 -1
- package/dist/AST/FunctionNode.d.ts +0 -20
- package/dist/AST/FunctionNode.js +0 -220
- package/dist/AST/FunctionNode.js.map +0 -1
- package/dist/AST/IfStatementNode.d.ts +0 -14
- package/dist/AST/IfStatementNode.js +0 -168
- package/dist/AST/IfStatementNode.js.map +0 -1
- package/dist/AST/InNode.d.ts +0 -15
- package/dist/AST/InNode.js +0 -107
- package/dist/AST/InNode.js.map +0 -1
- package/dist/AST/IndexNode.d.ts +0 -16
- package/dist/AST/IndexNode.js +0 -152
- package/dist/AST/IndexNode.js.map +0 -1
- package/dist/AST/LiteralNode.d.ts +0 -10
- package/dist/AST/LiteralNode.js +0 -74
- package/dist/AST/LiteralNode.js.map +0 -1
- package/dist/AST/LoopNode.d.ts +0 -12
- package/dist/AST/LoopNode.js +0 -121
- package/dist/AST/LoopNode.js.map +0 -1
- package/dist/AST/ModifierNode.d.ts +0 -14
- package/dist/AST/ModifierNode.js +0 -90
- package/dist/AST/ModifierNode.js.map +0 -1
- package/dist/AST/NamedStackNode.d.ts +0 -28
- package/dist/AST/NamedStackNode.js +0 -142
- package/dist/AST/NamedStackNode.js.map +0 -1
- package/dist/AST/Node.d.ts +0 -28
- package/dist/AST/Node.js +0 -263
- package/dist/AST/Node.js.map +0 -1
- package/dist/AST/NotNode.d.ts +0 -12
- package/dist/AST/NotNode.js +0 -103
- package/dist/AST/NotNode.js.map +0 -1
- package/dist/AST/NumberLiteralNode.d.ts +0 -5
- package/dist/AST/NumberLiteralNode.js +0 -36
- package/dist/AST/NumberLiteralNode.js.map +0 -1
- package/dist/AST/ObjectNode.d.ts +0 -14
- package/dist/AST/ObjectNode.js +0 -147
- package/dist/AST/ObjectNode.js.map +0 -1
- package/dist/AST/OnNode.d.ts +0 -9
- package/dist/AST/OnNode.js +0 -129
- package/dist/AST/OnNode.js.map +0 -1
- package/dist/AST/RootScopeMemberNode.d.ts +0 -12
- package/dist/AST/RootScopeMemberNode.js +0 -90
- package/dist/AST/RootScopeMemberNode.js.map +0 -1
- package/dist/AST/ScopeMemberNode.d.ts +0 -13
- package/dist/AST/ScopeMemberNode.js +0 -165
- package/dist/AST/ScopeMemberNode.js.map +0 -1
- package/dist/AST/ScopeNodeAbstract.d.ts +0 -8
- package/dist/AST/ScopeNodeAbstract.js +0 -105
- package/dist/AST/ScopeNodeAbstract.js.map +0 -1
- package/dist/AST/StringFormatNode.d.ts +0 -18
- package/dist/AST/StringFormatNode.js +0 -151
- package/dist/AST/StringFormatNode.js.map +0 -1
- package/dist/AST/UnitLiteralNode.d.ts +0 -15
- package/dist/AST/UnitLiteralNode.js +0 -72
- package/dist/AST/UnitLiteralNode.js.map +0 -1
- package/dist/AST/WASM/Context.d.ts +0 -4
- package/dist/AST/WASM/Context.js +0 -18
- package/dist/AST/WASM/Context.js.map +0 -1
- package/dist/AST/WASM/Function.d.ts +0 -22
- package/dist/AST/WASM/Function.js +0 -126
- package/dist/AST/WASM/Function.js.map +0 -1
- package/dist/AST/WASM/Memory.d.ts +0 -12
- package/dist/AST/WASM/Memory.js +0 -22
- package/dist/AST/WASM/Memory.js.map +0 -1
- package/dist/AST/WASM/Section.d.ts +0 -5
- package/dist/AST/WASM/Section.js +0 -11
- package/dist/AST/WASM/Section.js.map +0 -1
- package/dist/AST/WASM.d.ts +0 -58
- package/dist/AST/WASM.js +0 -293
- package/dist/AST/WASM.js.map +0 -1
- package/dist/AST/WithNode.d.ts +0 -15
- package/dist/AST/WithNode.js +0 -197
- package/dist/AST/WithNode.js.map +0 -1
- package/dist/AST/XHRNode.d.ts +0 -15
- package/dist/AST/XHRNode.js +0 -151
- package/dist/AST/XHRNode.js.map +0 -1
- package/dist/AST.d.ts +0 -160
- package/dist/AST.js +0 -1156
- package/dist/AST.js.map +0 -1
- package/dist/Attribute.d.ts +0 -46
- package/dist/Attribute.js +0 -262
- package/dist/Attribute.js.map +0 -1
- package/dist/Bencmark.d.ts +0 -14
- package/dist/Bencmark.js +0 -236
- package/dist/Bencmark.js.map +0 -1
- package/dist/Component.d.ts +0 -7
- package/dist/Component.js +0 -179
- package/dist/Component.js.map +0 -1
- package/dist/Configuration.d.ts +0 -12
- package/dist/Configuration.js +0 -64
- package/dist/Configuration.js.map +0 -1
- package/dist/Controller.d.ts +0 -13
- package/dist/Controller.js +0 -60
- package/dist/Controller.js.map +0 -1
- package/dist/DOM/AbstractDOM.d.ts +0 -56
- package/dist/DOM/AbstractDOM.js +0 -1038
- package/dist/DOM/AbstractDOM.js.map +0 -1
- package/dist/DOM/DOMObject.d.ts +0 -33
- package/dist/DOM/DOMObject.js +0 -152
- package/dist/DOM/DOMObject.js.map +0 -1
- package/dist/DOM/ShadowDOM.d.ts +0 -5
- package/dist/DOM/ShadowDOM.js +0 -32
- package/dist/DOM/ShadowDOM.js.map +0 -1
- package/dist/DOM/WrappedDocument.d.ts +0 -5
- package/dist/DOM/WrappedDocument.js +0 -34
- package/dist/DOM/WrappedDocument.js.map +0 -1
- package/dist/DOM/WrappedWindow.d.ts +0 -6
- package/dist/DOM/WrappedWindow.js +0 -45
- package/dist/DOM/WrappedWindow.js.map +0 -1
- package/dist/DOM.d.ts +0 -5
- package/dist/DOM.js +0 -37
- package/dist/DOM.js.map +0 -1
- package/dist/EventDispatcher.d.ts +0 -36
- package/dist/EventDispatcher.js +0 -393
- package/dist/EventDispatcher.js.map +0 -1
- package/dist/Formats.d.ts +0 -5
- package/dist/Formats.js +0 -47
- package/dist/Formats.js.map +0 -1
- package/dist/MessageList.d.ts +0 -15
- package/dist/MessageList.js +0 -127
- package/dist/MessageList.js.map +0 -1
- package/dist/Model.d.ts +0 -12
- package/dist/Model.js +0 -92
- package/dist/Model.js.map +0 -1
- package/dist/Modifiers.d.ts +0 -17
- package/dist/Modifiers.js +0 -100
- package/dist/Modifiers.js.map +0 -1
- package/dist/Query.d.ts +0 -4
- package/dist/Query.js +0 -66
- package/dist/Query.js.map +0 -1
- package/dist/Registry.d.ts +0 -41
- package/dist/Registry.js +0 -165
- package/dist/Registry.js.map +0 -1
- package/dist/Scope/DynamicScopeData.d.ts +0 -6
- package/dist/Scope/DynamicScopeData.js +0 -83
- package/dist/Scope/DynamicScopeData.js.map +0 -1
- package/dist/Scope/ObjectAccessor.d.ts +0 -7
- package/dist/Scope/ObjectAccessor.js +0 -40
- package/dist/Scope/ObjectAccessor.js.map +0 -1
- package/dist/Scope/QueryReference.d.ts +0 -10
- package/dist/Scope/QueryReference.js +0 -103
- package/dist/Scope/QueryReference.js.map +0 -1
- package/dist/Scope/ScopeAbstract.d.ts +0 -9
- package/dist/Scope/ScopeAbstract.js +0 -28
- package/dist/Scope/ScopeAbstract.js.map +0 -1
- package/dist/Scope/ScopeData.d.ts +0 -4
- package/dist/Scope/ScopeData.js +0 -60
- package/dist/Scope/ScopeData.js.map +0 -1
- package/dist/Scope/ScopeDataAbstract.d.ts +0 -30
- package/dist/Scope/ScopeDataAbstract.js +0 -303
- package/dist/Scope/ScopeDataAbstract.js.map +0 -1
- package/dist/Scope/ScopeObject.d.ts +0 -3
- package/dist/Scope/ScopeObject.js +0 -28
- package/dist/Scope/ScopeObject.js.map +0 -1
- package/dist/Scope/ScopeReference.d.ts +0 -10
- package/dist/Scope/ScopeReference.js +0 -73
- package/dist/Scope/ScopeReference.js.map +0 -1
- package/dist/Scope/ScopedVariableType.d.ts +0 -6
- package/dist/Scope/ScopedVariableType.js +0 -14
- package/dist/Scope/ScopedVariableType.js.map +0 -1
- package/dist/Scope/WrappedArray.d.ts +0 -21
- package/dist/Scope/WrappedArray.js +0 -252
- package/dist/Scope/WrappedArray.js.map +0 -1
- package/dist/Scope/properties/ArrayProperty.d.ts +0 -12
- package/dist/Scope/properties/ArrayProperty.js +0 -88
- package/dist/Scope/properties/ArrayProperty.js.map +0 -1
- package/dist/Scope/properties/FloatProperty.d.ts +0 -4
- package/dist/Scope/properties/FloatProperty.js +0 -30
- package/dist/Scope/properties/FloatProperty.js.map +0 -1
- package/dist/Scope/properties/IntegerProperty.d.ts +0 -4
- package/dist/Scope/properties/IntegerProperty.js +0 -30
- package/dist/Scope/properties/IntegerProperty.js.map +0 -1
- package/dist/Scope/properties/Property.d.ts +0 -30
- package/dist/Scope/properties/Property.js +0 -205
- package/dist/Scope/properties/Property.js.map +0 -1
- package/dist/Scope/properties/_imports.d.ts +0 -4
- package/dist/Scope/properties/_imports.js +0 -13
- package/dist/Scope/properties/_imports.js.map +0 -1
- package/dist/Scope.d.ts +0 -39
- package/dist/Scope.js +0 -434
- package/dist/Scope.js.map +0 -1
- package/dist/Service.d.ts +0 -9
- package/dist/Service.js +0 -49
- package/dist/Service.js.map +0 -1
- package/dist/Tag/ShadowRootTag.d.ts +0 -3
- package/dist/Tag/ShadowRootTag.js +0 -28
- package/dist/Tag/ShadowRootTag.js.map +0 -1
- package/dist/Tag/SlotTag.d.ts +0 -3
- package/dist/Tag/SlotTag.js +0 -28
- package/dist/Tag/SlotTag.js.map +0 -1
- package/dist/Tag/SlottedTag.d.ts +0 -7
- package/dist/Tag/SlottedTag.js +0 -78
- package/dist/Tag/SlottedTag.js.map +0 -1
- package/dist/Tag/TagList.d.ts +0 -13
- package/dist/Tag/TagList.js +0 -104
- package/dist/Tag/TagList.js.map +0 -1
- package/dist/Tag.d.ts +0 -117
- package/dist/Tag.js +0 -1471
- package/dist/Tag.js.map +0 -1
- package/dist/Types.d.ts +0 -8
- package/dist/Types.js +0 -54
- package/dist/Types.js.map +0 -1
- package/dist/Validators.d.ts +0 -7
- package/dist/Validators.js +0 -54
- package/dist/Validators.js.map +0 -1
- package/dist/attributes/AddClassIf.d.ts +0 -4
- package/dist/attributes/AddClassIf.js +0 -93
- package/dist/attributes/AddClassIf.js.map +0 -1
- package/dist/attributes/Bind.d.ts +0 -24
- package/dist/attributes/Bind.js +0 -273
- package/dist/attributes/Bind.js.map +0 -1
- package/dist/attributes/ComponentAttribute.d.ts +0 -5
- package/dist/attributes/ComponentAttribute.js +0 -110
- package/dist/attributes/ComponentAttribute.js.map +0 -1
- package/dist/attributes/ControllerAttribute.d.ts +0 -11
- package/dist/attributes/ControllerAttribute.js +0 -127
- package/dist/attributes/ControllerAttribute.js.map +0 -1
- package/dist/attributes/DisableIf.d.ts +0 -5
- package/dist/attributes/DisableIf.js +0 -94
- package/dist/attributes/DisableIf.js.map +0 -1
- package/dist/attributes/Exec.d.ts +0 -10
- package/dist/attributes/Exec.js +0 -133
- package/dist/attributes/Exec.js.map +0 -1
- package/dist/attributes/Format.d.ts +0 -5
- package/dist/attributes/Format.js +0 -99
- package/dist/attributes/Format.js.map +0 -1
- package/dist/attributes/If.d.ts +0 -11
- package/dist/attributes/If.js +0 -159
- package/dist/attributes/If.js.map +0 -1
- package/dist/attributes/JSONAttribute.d.ts +0 -5
- package/dist/attributes/JSONAttribute.js +0 -119
- package/dist/attributes/JSONAttribute.js.map +0 -1
- package/dist/attributes/KeyAbstract.d.ts +0 -7
- package/dist/attributes/KeyAbstract.js +0 -117
- package/dist/attributes/KeyAbstract.js.map +0 -1
- package/dist/attributes/KeyDown.d.ts +0 -4
- package/dist/attributes/KeyDown.js +0 -88
- package/dist/attributes/KeyDown.js.map +0 -1
- package/dist/attributes/KeyUp.d.ts +0 -4
- package/dist/attributes/KeyUp.js +0 -88
- package/dist/attributes/KeyUp.js.map +0 -1
- package/dist/attributes/LazyAttribute.d.ts +0 -8
- package/dist/attributes/LazyAttribute.js +0 -122
- package/dist/attributes/LazyAttribute.js.map +0 -1
- package/dist/attributes/List.d.ts +0 -18
- package/dist/attributes/List.js +0 -396
- package/dist/attributes/List.js.map +0 -1
- package/dist/attributes/ListItem.d.ts +0 -12
- package/dist/attributes/ListItem.js +0 -119
- package/dist/attributes/ListItem.js.map +0 -1
- package/dist/attributes/ListItemModel.d.ts +0 -4
- package/dist/attributes/ListItemModel.js +0 -39
- package/dist/attributes/ListItemModel.js.map +0 -1
- package/dist/attributes/ModelAttribute.d.ts +0 -5
- package/dist/attributes/ModelAttribute.js +0 -41
- package/dist/attributes/ModelAttribute.js.map +0 -1
- package/dist/attributes/Name.d.ts +0 -6
- package/dist/attributes/Name.js +0 -88
- package/dist/attributes/Name.js.map +0 -1
- package/dist/attributes/On.d.ts +0 -9
- package/dist/attributes/On.js +0 -135
- package/dist/attributes/On.js.map +0 -1
- package/dist/attributes/PersistAttribute.d.ts +0 -15
- package/dist/attributes/PersistAttribute.js +0 -215
- package/dist/attributes/PersistAttribute.js.map +0 -1
- package/dist/attributes/Referenced.d.ts +0 -3
- package/dist/attributes/Referenced.js +0 -38
- package/dist/attributes/Referenced.js.map +0 -1
- package/dist/attributes/RootAttribute.d.ts +0 -7
- package/dist/attributes/RootAttribute.js +0 -141
- package/dist/attributes/RootAttribute.js.map +0 -1
- package/dist/attributes/ScopeAttribute.d.ts +0 -9
- package/dist/attributes/ScopeAttribute.js +0 -152
- package/dist/attributes/ScopeAttribute.js.map +0 -1
- package/dist/attributes/ScopeChange.d.ts +0 -10
- package/dist/attributes/ScopeChange.js +0 -153
- package/dist/attributes/ScopeChange.js.map +0 -1
- package/dist/attributes/ScriptAttribute.d.ts +0 -4
- package/dist/attributes/ScriptAttribute.js +0 -45
- package/dist/attributes/ScriptAttribute.js.map +0 -1
- package/dist/attributes/ServiceAttribute.d.ts +0 -7
- package/dist/attributes/ServiceAttribute.js +0 -45
- package/dist/attributes/ServiceAttribute.js.map +0 -1
- package/dist/attributes/SetAttribute.d.ts +0 -11
- package/dist/attributes/SetAttribute.js +0 -146
- package/dist/attributes/SetAttribute.js.map +0 -1
- package/dist/attributes/StandardAttribute.d.ts +0 -15
- package/dist/attributes/StandardAttribute.js +0 -170
- package/dist/attributes/StandardAttribute.js.map +0 -1
- package/dist/attributes/StyleAttribute.d.ts +0 -14
- package/dist/attributes/StyleAttribute.js +0 -218
- package/dist/attributes/StyleAttribute.js.map +0 -1
- package/dist/attributes/StyleVarAttribute.d.ts +0 -11
- package/dist/attributes/StyleVarAttribute.js +0 -124
- package/dist/attributes/StyleVarAttribute.js.map +0 -1
- package/dist/attributes/TemplateAttribute.d.ts +0 -5
- package/dist/attributes/TemplateAttribute.js +0 -89
- package/dist/attributes/TemplateAttribute.js.map +0 -1
- package/dist/attributes/TypeAttribute.d.ts +0 -5
- package/dist/attributes/TypeAttribute.js +0 -104
- package/dist/attributes/TypeAttribute.js.map +0 -1
- package/dist/attributes/XHRAttribute.d.ts +0 -14
- package/dist/attributes/XHRAttribute.js +0 -242
- package/dist/attributes/XHRAttribute.js.map +0 -1
- package/dist/attributes/_imports.d.ts +0 -32
- package/dist/attributes/_imports.js +0 -68
- package/dist/attributes/_imports.js.map +0 -1
- package/dist/contrib/XHR.d.ts +0 -21
- package/dist/contrib/XHR.js +0 -78
- package/dist/contrib/XHR.js.map +0 -1
- package/dist/contrib/_imports.d.ts +0 -1
- package/dist/contrib/_imports.js +0 -6
- package/dist/contrib/_imports.js.map +0 -1
- package/dist/custom-elements.d.ts +0 -9
- package/dist/custom-elements.js +0 -44
- package/dist/custom-elements.js.map +0 -1
- package/dist/demo/ServiceDemo.d.ts +0 -5
- package/dist/demo/ServiceDemo.js +0 -87
- package/dist/demo/ServiceDemo.js.map +0 -1
- package/dist/demo.d.ts +0 -2
- package/dist/demo.js +0 -17
- package/dist/demo.js.map +0 -1
- package/dist/helpers/DOMHelper.d.ts +0 -3
- package/dist/helpers/DOMHelper.js +0 -81
- package/dist/helpers/DOMHelper.js.map +0 -1
- package/dist/helpers/ElementHelper.d.ts +0 -4
- package/dist/helpers/ElementHelper.js +0 -53
- package/dist/helpers/ElementHelper.js.map +0 -1
- package/dist/helpers/VisionHelper.d.ts +0 -13
- package/dist/helpers/VisionHelper.js +0 -148
- package/dist/helpers/VisionHelper.js.map +0 -1
- package/dist/helpers/decorators.d.ts +0 -5
- package/dist/helpers/decorators.js +0 -59
- package/dist/helpers/decorators.js.map +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -5
- package/dist/version.js.map +0 -1
- package/dist/vsn.d.ts +0 -36
- package/dist/vsn.js +0 -201
- package/dist/vsn.js.map +0 -1
- package/karma.conf.js +0 -34
- package/src/AST/ArithmeticNode.ts +0 -52
- package/src/AST/ArrayNode.ts +0 -39
- package/src/AST/AsNode.ts +0 -32
- package/src/AST/AssignmentNode.ts +0 -256
- package/src/AST/BlockNode.ts +0 -25
- package/src/AST/BooleanLiteralNode.ts +0 -10
- package/src/AST/ClassNode.ts +0 -267
- package/src/AST/ComparisonNode.ts +0 -57
- package/src/AST/ConditionalNode.ts +0 -36
- package/src/AST/DispatchEventNode.ts +0 -58
- package/src/AST/ElementAttributeNode.ts +0 -97
- package/src/AST/ElementQueryNode.ts +0 -48
- package/src/AST/ElementStyleNode.ts +0 -74
- package/src/AST/ForStatementNode.ts +0 -59
- package/src/AST/FunctionArgumentNode.ts +0 -27
- package/src/AST/FunctionCallNode.ts +0 -93
- package/src/AST/FunctionNode.ts +0 -82
- package/src/AST/IfStatementNode.ts +0 -67
- package/src/AST/InNode.ts +0 -46
- package/src/AST/IndexNode.ts +0 -64
- package/src/AST/LiteralNode.ts +0 -17
- package/src/AST/LoopNode.ts +0 -35
- package/src/AST/ModifierNode.ts +0 -32
- package/src/AST/NamedStackNode.ts +0 -83
- package/src/AST/Node.ts +0 -104
- package/src/AST/NotNode.ts +0 -41
- package/src/AST/NumberLiteralNode.ts +0 -14
- package/src/AST/ObjectNode.ts +0 -55
- package/src/AST/OnNode.ts +0 -23
- package/src/AST/RootScopeMemberNode.ts +0 -27
- package/src/AST/ScopeMemberNode.ts +0 -63
- package/src/AST/ScopeNodeAbstract.ts +0 -21
- package/src/AST/StringFormatNode.ts +0 -43
- package/src/AST/UnitLiteralNode.ts +0 -51
- package/src/AST/WASM/Context.ts +0 -12
- package/src/AST/WASM/Function.ts +0 -67
- package/src/AST/WASM/Memory.ts +0 -21
- package/src/AST/WASM/Section.ts +0 -6
- package/src/AST/WASM.ts +0 -244
- package/src/AST/WithNode.ts +0 -68
- package/src/AST/XHRNode.ts +0 -85
- package/src/AST.ts +0 -969
- package/src/Attribute.ts +0 -130
- package/src/Bencmark.ts +0 -184
- package/src/Component.ts +0 -63
- package/src/Configuration.ts +0 -47
- package/src/Controller.ts +0 -36
- package/src/DOM/AbstractDOM.ts +0 -462
- package/src/DOM/DOMObject.ts +0 -77
- package/src/DOM/ShadowDOM.ts +0 -15
- package/src/DOM/WrappedDocument.ts +0 -9
- package/src/DOM/WrappedWindow.ts +0 -21
- package/src/DOM.ts +0 -13
- package/src/EventDispatcher.ts +0 -234
- package/src/Formats.ts +0 -33
- package/src/MessageList.ts +0 -85
- package/src/Model.ts +0 -44
- package/src/Modifiers.ts +0 -54
- package/src/Query.ts +0 -17
- package/src/Registry.ts +0 -141
- package/src/Scope/DynamicScopeData.ts +0 -27
- package/src/Scope/ObjectAccessor.ts +0 -21
- package/src/Scope/QueryReference.ts +0 -29
- package/src/Scope/ScopeAbstract.ts +0 -11
- package/src/Scope/ScopeData.ts +0 -20
- package/src/Scope/ScopeDataAbstract.ts +0 -200
- package/src/Scope/ScopeObject.ts +0 -3
- package/src/Scope/ScopeReference.ts +0 -30
- package/src/Scope/ScopedVariableType.ts +0 -7
- package/src/Scope/WrappedArray.ts +0 -134
- package/src/Scope/properties/ArrayProperty.ts +0 -46
- package/src/Scope/properties/FloatProperty.ts +0 -5
- package/src/Scope/properties/IntegerProperty.ts +0 -5
- package/src/Scope/properties/Property.ts +0 -173
- package/src/Scope/properties/_imports.ts +0 -4
- package/src/Scope.ts +0 -333
- package/src/Service.ts +0 -24
- package/src/Tag/ShadowRootTag.ts +0 -5
- package/src/Tag/SlotTag.ts +0 -5
- package/src/Tag/SlottedTag.ts +0 -17
- package/src/Tag/TagList.ts +0 -52
- package/src/Tag.ts +0 -838
- package/src/Types.ts +0 -34
- package/src/Validators.ts +0 -45
- package/src/attributes/AddClassIf.ts +0 -14
- package/src/attributes/Bind.ts +0 -144
- package/src/attributes/ComponentAttribute.ts +0 -23
- package/src/attributes/ControllerAttribute.ts +0 -50
- package/src/attributes/DisableIf.ts +0 -16
- package/src/attributes/Exec.ts +0 -32
- package/src/attributes/Format.ts +0 -18
- package/src/attributes/If.ts +0 -40
- package/src/attributes/JSONAttribute.ts +0 -40
- package/src/attributes/KeyAbstract.ts +0 -28
- package/src/attributes/KeyDown.ts +0 -10
- package/src/attributes/KeyUp.ts +0 -10
- package/src/attributes/LazyAttribute.ts +0 -30
- package/src/attributes/List.ts +0 -210
- package/src/attributes/ListItem.ts +0 -30
- package/src/attributes/ListItemModel.ts +0 -7
- package/src/attributes/ModelAttribute.ts +0 -8
- package/src/attributes/Name.ts +0 -16
- package/src/attributes/On.ts +0 -39
- package/src/attributes/PersistAttribute.ts +0 -83
- package/src/attributes/Referenced.ts +0 -5
- package/src/attributes/RootAttribute.ts +0 -24
- package/src/attributes/ScopeAttribute.ts +0 -40
- package/src/attributes/ScopeChange.ts +0 -35
- package/src/attributes/ScriptAttribute.ts +0 -9
- package/src/attributes/ServiceAttribute.ts +0 -13
- package/src/attributes/SetAttribute.ts +0 -44
- package/src/attributes/StandardAttribute.ts +0 -72
- package/src/attributes/StyleAttribute.ts +0 -90
- package/src/attributes/StyleVarAttribute.ts +0 -40
- package/src/attributes/TemplateAttribute.ts +0 -12
- package/src/attributes/TypeAttribute.ts +0 -23
- package/src/attributes/XHRAttribute.ts +0 -109
- package/src/attributes/_imports.ts +0 -32
- package/src/contrib/XHR.ts +0 -46
- package/src/contrib/_imports.ts +0 -1
- package/src/custom-elements.ts +0 -46
- package/src/demo/ServiceDemo.ts +0 -12
- package/src/demo.ts +0 -2
- package/src/helpers/DOMHelper.ts +0 -17
- package/src/helpers/ElementHelper.ts +0 -26
- package/src/helpers/VisionHelper.ts +0 -88
- package/src/helpers/decorators.ts +0 -11
- package/src/version.ts +0 -2
- package/src/vsn.ts +0 -106
- package/test/AST/ArithmeticAssignmentNode.spec.ts +0 -45
- package/test/AST/ClassNode.spec.ts +0 -175
- package/test/AST/FunctionNode.spec.ts +0 -51
- package/test/AST/StringFormatNode.spec.ts +0 -12
- package/test/AST/WASM.spec.ts +0 -63
- package/test/AST/XHRNode.spec.ts +0 -10
- package/test/AST.spec.ts +0 -353
- package/test/Controller.spec.ts +0 -42
- package/test/DOM.spec.ts +0 -63
- package/test/EventDispatcher.spec.ts +0 -191
- package/test/MessageList.spec.ts +0 -101
- package/test/Model/DataModel.spec.ts +0 -0
- package/test/Scope/DynamicScopeData.spec.ts +0 -141
- package/test/Scope/ScopeData.spec.ts +0 -58
- package/test/Scope/WrappedArray.spec.ts +0 -11
- package/test/Scope/properties/ArrayProperty.spec.ts +0 -23
- package/test/Scope.spec.ts +0 -69
- package/test/Tag/TagList.spec.ts +0 -21
- package/test/Tag.spec.ts +0 -4
- package/test/attributes/Bind.spec.ts +0 -174
- package/test/attributes/JSONAttribute.spec.ts +0 -91
- package/test/attributes/ListItem.spec.ts +0 -118
- package/test/attributes/ScopeAttribute.spec.ts +0 -35
- package/test/attributes/ServiceAttribute.spec.ts +0 -41
- package/test/attributes/SetAttribute.spec.ts +0 -55
- package/test/attributes/Styles.spec.ts +0 -43
- package/test/globals.js +0 -2
- package/tsconfig.base.json +0 -17
- package/tsconfig.json +0 -6
- package/tsconfig.test.json +0 -7
- package/types/vsn-component.d.ts +0 -5
- package/webpack.config.js +0 -48
- package/webpack.development.js +0 -6
- package/webpack.production.js +0 -5
package/dist/AST.js
DELETED
|
@@ -1,1156 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __values = (this && this.__values) || function(o) {
|
|
39
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
-
if (m) return m.call(o);
|
|
41
|
-
if (o && typeof o.length === "number") return {
|
|
42
|
-
next: function () {
|
|
43
|
-
if (o && i >= o.length) o = void 0;
|
|
44
|
-
return { value: o && o[i++], done: !o };
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
-
};
|
|
49
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
50
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51
|
-
if (!m) return o;
|
|
52
|
-
var i = m.call(o), r, ar = [], e;
|
|
53
|
-
try {
|
|
54
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
-
}
|
|
56
|
-
catch (error) { e = { error: error }; }
|
|
57
|
-
finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
}
|
|
61
|
-
finally { if (e) throw e.error; }
|
|
62
|
-
}
|
|
63
|
-
return ar;
|
|
64
|
-
};
|
|
65
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
66
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
67
|
-
to[j] = from[i];
|
|
68
|
-
return to;
|
|
69
|
-
};
|
|
70
|
-
var _a, _b, _c;
|
|
71
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
|
-
exports.Tree = exports.TreeCache = exports.AttributableNodes = exports.tokenIsBlockCloser = exports.tokenIsBlockOpener = exports.getTokenBlockOpenerConfig = exports.BlockCloseToTypeMap = exports.BlockOpenToTypeMap = exports.BlockTypeConfigurations = exports.TokenType = exports.BlockType = void 0;
|
|
73
|
-
var DOM_1 = require("./DOM");
|
|
74
|
-
var Tag_1 = require("./Tag");
|
|
75
|
-
var RootScopeMemberNode_1 = require("./AST/RootScopeMemberNode");
|
|
76
|
-
var ScopeMemberNode_1 = require("./AST/ScopeMemberNode");
|
|
77
|
-
var ElementAttributeNode_1 = require("./AST/ElementAttributeNode");
|
|
78
|
-
var BlockNode_1 = require("./AST/BlockNode");
|
|
79
|
-
var LiteralNode_1 = require("./AST/LiteralNode");
|
|
80
|
-
var IfStatementNode_1 = require("./AST/IfStatementNode");
|
|
81
|
-
var ForStatementNode_1 = require("./AST/ForStatementNode");
|
|
82
|
-
var NumberLiteralNode_1 = require("./AST/NumberLiteralNode");
|
|
83
|
-
var ElementQueryNode_1 = require("./AST/ElementQueryNode");
|
|
84
|
-
var IndexNode_1 = require("./AST/IndexNode");
|
|
85
|
-
var ArrayNode_1 = require("./AST/ArrayNode");
|
|
86
|
-
var ObjectNode_1 = require("./AST/ObjectNode");
|
|
87
|
-
var ElementStyleNode_1 = require("./AST/ElementStyleNode");
|
|
88
|
-
var FunctionCallNode_1 = require("./AST/FunctionCallNode");
|
|
89
|
-
var FunctionArgumentNode_1 = require("./AST/FunctionArgumentNode");
|
|
90
|
-
var InNode_1 = require("./AST/InNode");
|
|
91
|
-
var ComparisonNode_1 = require("./AST/ComparisonNode");
|
|
92
|
-
var ArithmeticNode_1 = require("./AST/ArithmeticNode");
|
|
93
|
-
var AssignmentNode_1 = require("./AST/AssignmentNode");
|
|
94
|
-
var UnitLiteralNode_1 = require("./AST/UnitLiteralNode");
|
|
95
|
-
var BooleanLiteralNode_1 = require("./AST/BooleanLiteralNode");
|
|
96
|
-
var NotNode_1 = require("./AST/NotNode");
|
|
97
|
-
var XHRNode_1 = require("./AST/XHRNode");
|
|
98
|
-
var StringFormatNode_1 = require("./AST/StringFormatNode");
|
|
99
|
-
var FunctionNode_1 = require("./AST/FunctionNode");
|
|
100
|
-
var ClassNode_1 = require("./AST/ClassNode");
|
|
101
|
-
var OnNode_1 = require("./AST/OnNode");
|
|
102
|
-
var ModifierNode_1 = require("./AST/ModifierNode");
|
|
103
|
-
var DispatchEventNode_1 = require("./AST/DispatchEventNode");
|
|
104
|
-
var WithNode_1 = require("./AST/WithNode");
|
|
105
|
-
var AsNode_1 = require("./AST/AsNode");
|
|
106
|
-
var NamedStackNode_1 = require("./AST/NamedStackNode");
|
|
107
|
-
var LoopNode_1 = require("./AST/LoopNode");
|
|
108
|
-
function lower(str) {
|
|
109
|
-
return str ? str.toLowerCase() : null;
|
|
110
|
-
}
|
|
111
|
-
var BlockType;
|
|
112
|
-
(function (BlockType) {
|
|
113
|
-
BlockType[BlockType["BRACE"] = 0] = "BRACE";
|
|
114
|
-
BlockType[BlockType["BRACKET"] = 1] = "BRACKET";
|
|
115
|
-
BlockType[BlockType["PAREN"] = 2] = "PAREN";
|
|
116
|
-
BlockType[BlockType["STATEMENT"] = 3] = "STATEMENT";
|
|
117
|
-
})(BlockType = exports.BlockType || (exports.BlockType = {}));
|
|
118
|
-
var TokenType;
|
|
119
|
-
(function (TokenType) {
|
|
120
|
-
TokenType[TokenType["NULL"] = 0] = "NULL";
|
|
121
|
-
TokenType[TokenType["WHITESPACE"] = 1] = "WHITESPACE";
|
|
122
|
-
TokenType[TokenType["TYPE_INT"] = 2] = "TYPE_INT";
|
|
123
|
-
TokenType[TokenType["TYPE_UINT"] = 3] = "TYPE_UINT";
|
|
124
|
-
TokenType[TokenType["TYPE_FLOAT"] = 4] = "TYPE_FLOAT";
|
|
125
|
-
TokenType[TokenType["TYPE_STRING"] = 5] = "TYPE_STRING";
|
|
126
|
-
TokenType[TokenType["TYPE_BOOL"] = 6] = "TYPE_BOOL";
|
|
127
|
-
TokenType[TokenType["RETURN"] = 7] = "RETURN";
|
|
128
|
-
TokenType[TokenType["NOT"] = 8] = "NOT";
|
|
129
|
-
TokenType[TokenType["OF"] = 9] = "OF";
|
|
130
|
-
TokenType[TokenType["AS"] = 10] = "AS";
|
|
131
|
-
TokenType[TokenType["IN"] = 11] = "IN";
|
|
132
|
-
TokenType[TokenType["WITH"] = 12] = "WITH";
|
|
133
|
-
TokenType[TokenType["NAMED_STACK"] = 13] = "NAMED_STACK";
|
|
134
|
-
TokenType[TokenType["FOR"] = 14] = "FOR";
|
|
135
|
-
TokenType[TokenType["IF"] = 15] = "IF";
|
|
136
|
-
TokenType[TokenType["ELSE_IF"] = 16] = "ELSE_IF";
|
|
137
|
-
TokenType[TokenType["ELSE"] = 17] = "ELSE";
|
|
138
|
-
TokenType[TokenType["FUNC"] = 18] = "FUNC";
|
|
139
|
-
TokenType[TokenType["LOOP"] = 19] = "LOOP";
|
|
140
|
-
TokenType[TokenType["ON"] = 20] = "ON";
|
|
141
|
-
TokenType[TokenType["CLASS"] = 21] = "CLASS";
|
|
142
|
-
TokenType[TokenType["NAME"] = 22] = "NAME";
|
|
143
|
-
TokenType[TokenType["L_BRACE"] = 23] = "L_BRACE";
|
|
144
|
-
TokenType[TokenType["R_BRACE"] = 24] = "R_BRACE";
|
|
145
|
-
TokenType[TokenType["L_BRACKET"] = 25] = "L_BRACKET";
|
|
146
|
-
TokenType[TokenType["R_BRACKET"] = 26] = "R_BRACKET";
|
|
147
|
-
TokenType[TokenType["L_PAREN"] = 27] = "L_PAREN";
|
|
148
|
-
TokenType[TokenType["R_PAREN"] = 28] = "R_PAREN";
|
|
149
|
-
TokenType[TokenType["TILDE"] = 29] = "TILDE";
|
|
150
|
-
TokenType[TokenType["PERIOD"] = 30] = "PERIOD";
|
|
151
|
-
TokenType[TokenType["COMMA"] = 31] = "COMMA";
|
|
152
|
-
TokenType[TokenType["COLON"] = 32] = "COLON";
|
|
153
|
-
TokenType[TokenType["SEMICOLON"] = 33] = "SEMICOLON";
|
|
154
|
-
TokenType[TokenType["STRING_FORMAT"] = 34] = "STRING_FORMAT";
|
|
155
|
-
TokenType[TokenType["STRING_LITERAL"] = 35] = "STRING_LITERAL";
|
|
156
|
-
TokenType[TokenType["NUMBER_LITERAL"] = 36] = "NUMBER_LITERAL";
|
|
157
|
-
TokenType[TokenType["BOOLEAN_LITERAL"] = 37] = "BOOLEAN_LITERAL";
|
|
158
|
-
TokenType[TokenType["NULL_LITERAL"] = 38] = "NULL_LITERAL";
|
|
159
|
-
TokenType[TokenType["STRICT_EQUALS"] = 39] = "STRICT_EQUALS";
|
|
160
|
-
TokenType[TokenType["STRICT_NOT_EQUALS"] = 40] = "STRICT_NOT_EQUALS";
|
|
161
|
-
TokenType[TokenType["EQUALS"] = 41] = "EQUALS";
|
|
162
|
-
TokenType[TokenType["NOT_EQUALS"] = 42] = "NOT_EQUALS";
|
|
163
|
-
TokenType[TokenType["GREATER_THAN_EQUAL"] = 43] = "GREATER_THAN_EQUAL";
|
|
164
|
-
TokenType[TokenType["LESS_THAN_EQUAL"] = 44] = "LESS_THAN_EQUAL";
|
|
165
|
-
TokenType[TokenType["GREATER_THAN"] = 45] = "GREATER_THAN";
|
|
166
|
-
TokenType[TokenType["LESS_THAN"] = 46] = "LESS_THAN";
|
|
167
|
-
TokenType[TokenType["ASSIGN"] = 47] = "ASSIGN";
|
|
168
|
-
TokenType[TokenType["AND"] = 48] = "AND";
|
|
169
|
-
TokenType[TokenType["OR"] = 49] = "OR";
|
|
170
|
-
TokenType[TokenType["ADD"] = 50] = "ADD";
|
|
171
|
-
TokenType[TokenType["SUBTRACT"] = 51] = "SUBTRACT";
|
|
172
|
-
TokenType[TokenType["MULTIPLY"] = 52] = "MULTIPLY";
|
|
173
|
-
TokenType[TokenType["DIVIDE"] = 53] = "DIVIDE";
|
|
174
|
-
TokenType[TokenType["ADD_ASSIGN"] = 54] = "ADD_ASSIGN";
|
|
175
|
-
TokenType[TokenType["SUBTRACT_ASSIGN"] = 55] = "SUBTRACT_ASSIGN";
|
|
176
|
-
TokenType[TokenType["MULTIPLY_ASSIGN"] = 56] = "MULTIPLY_ASSIGN";
|
|
177
|
-
TokenType[TokenType["DIVIDE_ASSIGN"] = 57] = "DIVIDE_ASSIGN";
|
|
178
|
-
TokenType[TokenType["EXCLAMATION_POINT"] = 58] = "EXCLAMATION_POINT";
|
|
179
|
-
TokenType[TokenType["ELEMENT_REFERENCE"] = 59] = "ELEMENT_REFERENCE";
|
|
180
|
-
TokenType[TokenType["ELEMENT_ATTRIBUTE"] = 60] = "ELEMENT_ATTRIBUTE";
|
|
181
|
-
TokenType[TokenType["ELEMENT_STYLE"] = 61] = "ELEMENT_STYLE";
|
|
182
|
-
TokenType[TokenType["ELEMENT_QUERY"] = 62] = "ELEMENT_QUERY";
|
|
183
|
-
TokenType[TokenType["UNIT"] = 63] = "UNIT";
|
|
184
|
-
TokenType[TokenType["XHR_GET"] = 64] = "XHR_GET";
|
|
185
|
-
TokenType[TokenType["XHR_POST"] = 65] = "XHR_POST";
|
|
186
|
-
TokenType[TokenType["XHR_PUT"] = 66] = "XHR_PUT";
|
|
187
|
-
TokenType[TokenType["XHR_DELETE"] = 67] = "XHR_DELETE";
|
|
188
|
-
TokenType[TokenType["MODIFIER"] = 68] = "MODIFIER";
|
|
189
|
-
TokenType[TokenType["DISPATCH_EVENT"] = 69] = "DISPATCH_EVENT";
|
|
190
|
-
})(TokenType = exports.TokenType || (exports.TokenType = {}));
|
|
191
|
-
exports.BlockTypeConfigurations = (_a = {},
|
|
192
|
-
_a[BlockType.BRACE] = {
|
|
193
|
-
open: TokenType.L_BRACE,
|
|
194
|
-
close: TokenType.R_BRACE,
|
|
195
|
-
},
|
|
196
|
-
_a[BlockType.BRACKET] = {
|
|
197
|
-
open: TokenType.L_BRACKET,
|
|
198
|
-
close: TokenType.R_BRACKET,
|
|
199
|
-
},
|
|
200
|
-
_a[BlockType.PAREN] = {
|
|
201
|
-
open: TokenType.L_PAREN,
|
|
202
|
-
close: TokenType.R_PAREN,
|
|
203
|
-
},
|
|
204
|
-
_a);
|
|
205
|
-
exports.BlockOpenToTypeMap = (_b = {},
|
|
206
|
-
_b[TokenType.L_BRACE] = BlockType.BRACE,
|
|
207
|
-
_b[TokenType.L_BRACKET] = BlockType.BRACKET,
|
|
208
|
-
_b[TokenType.L_PAREN] = BlockType.PAREN,
|
|
209
|
-
_b);
|
|
210
|
-
exports.BlockCloseToTypeMap = (_c = {},
|
|
211
|
-
_c[TokenType.R_BRACE] = BlockType.BRACE,
|
|
212
|
-
_c[TokenType.R_BRACKET] = BlockType.BRACKET,
|
|
213
|
-
_c[TokenType.R_PAREN] = BlockType.PAREN,
|
|
214
|
-
_c);
|
|
215
|
-
function getTokenBlockOpenerConfig(opener) {
|
|
216
|
-
return exports.BlockTypeConfigurations[exports.BlockOpenToTypeMap[opener]];
|
|
217
|
-
}
|
|
218
|
-
exports.getTokenBlockOpenerConfig = getTokenBlockOpenerConfig;
|
|
219
|
-
function tokenIsBlockOpener(token) {
|
|
220
|
-
return exports.BlockOpenToTypeMap[token] !== undefined;
|
|
221
|
-
}
|
|
222
|
-
exports.tokenIsBlockOpener = tokenIsBlockOpener;
|
|
223
|
-
function tokenIsBlockCloser(token) {
|
|
224
|
-
return exports.BlockCloseToTypeMap[token] !== undefined;
|
|
225
|
-
}
|
|
226
|
-
exports.tokenIsBlockCloser = tokenIsBlockCloser;
|
|
227
|
-
var TOKEN_PATTERNS = [
|
|
228
|
-
{
|
|
229
|
-
type: TokenType.WHITESPACE,
|
|
230
|
-
pattern: /^[\s\n\r]+/
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
type: TokenType.XHR_POST,
|
|
234
|
-
pattern: /^>>/
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
type: TokenType.XHR_PUT,
|
|
238
|
-
pattern: /^<>/
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
type: TokenType.XHR_GET,
|
|
242
|
-
pattern: /^<</
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
type: TokenType.XHR_DELETE,
|
|
246
|
-
pattern: /^></
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
type: TokenType.DISPATCH_EVENT,
|
|
250
|
-
pattern: /^!!!?([_a-zA-Z][-_a-zA-Z0-9]+)/
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
type: TokenType.TYPE_INT,
|
|
254
|
-
pattern: /^int\s/
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
type: TokenType.TYPE_UINT,
|
|
258
|
-
pattern: /^uint\s/
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
type: TokenType.TYPE_FLOAT,
|
|
262
|
-
pattern: /^float\s/
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
type: TokenType.TYPE_BOOL,
|
|
266
|
-
pattern: /^bool\s/
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
type: TokenType.UNIT,
|
|
270
|
-
pattern: /^\d+\.?\d?(?:cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)/
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
type: TokenType.BOOLEAN_LITERAL,
|
|
274
|
-
pattern: /^(true|false)/
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
type: TokenType.NULL_LITERAL,
|
|
278
|
-
pattern: /^null/
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
type: TokenType.RETURN,
|
|
282
|
-
pattern: /^return\s/
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
type: TokenType.NOT,
|
|
286
|
-
pattern: /^not\s/
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
type: TokenType.OF,
|
|
290
|
-
pattern: /^of\s/
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
type: TokenType.IN,
|
|
294
|
-
pattern: /^in\s/
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
type: TokenType.AS,
|
|
298
|
-
pattern: /^as\s/
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
type: TokenType.WITH,
|
|
302
|
-
pattern: /^with(?=\||\s)?/ // Allows with|sequential
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
type: TokenType.NAMED_STACK,
|
|
306
|
-
pattern: /^stack(?=\||\s)?/
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
type: TokenType.FOR,
|
|
310
|
-
pattern: /^for\s?(?=\()/
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
type: TokenType.IF,
|
|
314
|
-
pattern: /^if\s?(?=\()/
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
type: TokenType.ELSE_IF,
|
|
318
|
-
pattern: /^else if\s?(?=\()/
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
type: TokenType.ELSE,
|
|
322
|
-
pattern: /^else\s?(?=\{)/
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
type: TokenType.FUNC,
|
|
326
|
-
pattern: /^func\s/
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
type: TokenType.LOOP,
|
|
330
|
-
pattern: /^loop\s/
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
type: TokenType.ON,
|
|
334
|
-
pattern: /^on\s/
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
type: TokenType.CLASS,
|
|
338
|
-
pattern: /^class\s([^{]+)/
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
type: TokenType.ELEMENT_ATTRIBUTE,
|
|
342
|
-
pattern: /^\.?@[-_a-zA-Z0-9]*/
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
type: TokenType.ELEMENT_STYLE,
|
|
346
|
-
pattern: /^\.?\$[-a-zA-Z0-9]*/
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
type: TokenType.ELEMENT_REFERENCE,
|
|
350
|
-
pattern: /^#[-_a-zA-Z0-9]*/
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
type: TokenType.ELEMENT_QUERY,
|
|
354
|
-
pattern: /^\?[>|<]?\(([#.\[\]:,=\-_a-zA-Z0-9*\s]*[\]_a-zA-Z0-9*])\)/
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
type: TokenType.NAME,
|
|
358
|
-
pattern: /^[_a-zA-Z][_a-zA-Z0-9]*/
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
type: TokenType.NUMBER_LITERAL,
|
|
362
|
-
pattern: /^-?\d+(?:\.\d+)?(?:e[+\-]?\d+)?/i
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
type: TokenType.L_BRACE,
|
|
366
|
-
pattern: /^{/
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
type: TokenType.R_BRACE,
|
|
370
|
-
pattern: /^}/
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
type: TokenType.L_BRACKET,
|
|
374
|
-
pattern: /^\[/
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
type: TokenType.R_BRACKET,
|
|
378
|
-
pattern: /^]/
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
type: TokenType.L_PAREN,
|
|
382
|
-
pattern: /^\(/
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
type: TokenType.R_PAREN,
|
|
386
|
-
pattern: /^\)/
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
type: TokenType.TILDE,
|
|
390
|
-
pattern: /^~/
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
type: TokenType.PERIOD,
|
|
394
|
-
pattern: /^\./
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
type: TokenType.COMMA,
|
|
398
|
-
pattern: /^,/
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
type: TokenType.EQUALS,
|
|
402
|
-
pattern: /^==/
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
type: TokenType.NOT_EQUALS,
|
|
406
|
-
pattern: /^!=/
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
type: TokenType.GREATER_THAN_EQUAL,
|
|
410
|
-
pattern: /^>=/
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
type: TokenType.LESS_THAN_EQUAL,
|
|
414
|
-
pattern: /^<=/
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
type: TokenType.GREATER_THAN,
|
|
418
|
-
pattern: /^>/
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
type: TokenType.LESS_THAN,
|
|
422
|
-
pattern: /^</
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
type: TokenType.COLON,
|
|
426
|
-
pattern: /^:/
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
type: TokenType.SEMICOLON,
|
|
430
|
-
pattern: /^;/
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
type: TokenType.STRING_FORMAT,
|
|
434
|
-
pattern: /^`([^`]*)`/
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
type: TokenType.STRING_LITERAL,
|
|
438
|
-
pattern: /^"([^"]*)"/
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
type: TokenType.STRING_LITERAL,
|
|
442
|
-
pattern: /^'([^']*)'/
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
type: TokenType.AND,
|
|
446
|
-
pattern: /^&&/
|
|
447
|
-
},
|
|
448
|
-
{
|
|
449
|
-
type: TokenType.OR,
|
|
450
|
-
pattern: /^\|\|/
|
|
451
|
-
},
|
|
452
|
-
{
|
|
453
|
-
type: TokenType.ADD_ASSIGN,
|
|
454
|
-
pattern: /^\+=/
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
type: TokenType.SUBTRACT_ASSIGN,
|
|
458
|
-
pattern: /^-=/
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
type: TokenType.MULTIPLY_ASSIGN,
|
|
462
|
-
pattern: /^\*=/
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
type: TokenType.DIVIDE_ASSIGN,
|
|
466
|
-
pattern: /^\/=/
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
type: TokenType.ADD,
|
|
470
|
-
pattern: /^\+/
|
|
471
|
-
},
|
|
472
|
-
{
|
|
473
|
-
type: TokenType.SUBTRACT,
|
|
474
|
-
pattern: /^-/
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
type: TokenType.MULTIPLY,
|
|
478
|
-
pattern: /^\*/
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
type: TokenType.DIVIDE,
|
|
482
|
-
pattern: /^\//
|
|
483
|
-
},
|
|
484
|
-
{
|
|
485
|
-
type: TokenType.ASSIGN,
|
|
486
|
-
pattern: /^=/
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
type: TokenType.EXCLAMATION_POINT,
|
|
490
|
-
pattern: /^!/
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
type: TokenType.MODIFIER,
|
|
494
|
-
pattern: /^\|[a-zA-Z0-9,]+/
|
|
495
|
-
}
|
|
496
|
-
];
|
|
497
|
-
exports.AttributableNodes = [
|
|
498
|
-
RootScopeMemberNode_1.RootScopeMemberNode,
|
|
499
|
-
ScopeMemberNode_1.ScopeMemberNode,
|
|
500
|
-
ElementAttributeNode_1.ElementAttributeNode
|
|
501
|
-
];
|
|
502
|
-
var TreeCache = /** @class */ (function () {
|
|
503
|
-
function TreeCache() {
|
|
504
|
-
this.cache = new Map();
|
|
505
|
-
this.lastUsed = new Map();
|
|
506
|
-
}
|
|
507
|
-
TreeCache.prototype.get = function (code) {
|
|
508
|
-
if (!this.cache.has(code))
|
|
509
|
-
return null;
|
|
510
|
-
this.lastUsed.set(code, Date.now());
|
|
511
|
-
return this.cache.get(code);
|
|
512
|
-
};
|
|
513
|
-
TreeCache.prototype.set = function (code, node) {
|
|
514
|
-
var e_1, _a;
|
|
515
|
-
this.cache.set(code, node);
|
|
516
|
-
this.lastUsed.set(code, Date.now());
|
|
517
|
-
if (this.cache.size > 200) {
|
|
518
|
-
var toRemove = 20;
|
|
519
|
-
try {
|
|
520
|
-
for (var _b = __values(Array.from(this.lastUsed.entries()).sort(function (a, b) { return a[1] - b[1]; })), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
521
|
-
var _d = __read(_c.value, 2), key = _d[0], lastUsed = _d[1];
|
|
522
|
-
this.cache.delete(key);
|
|
523
|
-
this.lastUsed.delete(key);
|
|
524
|
-
toRemove--;
|
|
525
|
-
if (toRemove === 0)
|
|
526
|
-
break;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
530
|
-
finally {
|
|
531
|
-
try {
|
|
532
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
533
|
-
}
|
|
534
|
-
finally { if (e_1) throw e_1.error; }
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
};
|
|
538
|
-
TreeCache.prototype.has = function (code) {
|
|
539
|
-
return this.cache.has(code);
|
|
540
|
-
};
|
|
541
|
-
return TreeCache;
|
|
542
|
-
}());
|
|
543
|
-
exports.TreeCache = TreeCache;
|
|
544
|
-
var Tree = /** @class */ (function () {
|
|
545
|
-
function Tree(code) {
|
|
546
|
-
this.code = code;
|
|
547
|
-
if (Tree.cache.has(code)) {
|
|
548
|
-
this._root = Tree.cache.get(code);
|
|
549
|
-
}
|
|
550
|
-
else {
|
|
551
|
-
this.parse();
|
|
552
|
-
Tree.cache.set(code, this._root);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
Object.defineProperty(Tree.prototype, "root", {
|
|
556
|
-
get: function () { return this._root; },
|
|
557
|
-
enumerable: false,
|
|
558
|
-
configurable: true
|
|
559
|
-
});
|
|
560
|
-
Tree.prototype.parse = function () {
|
|
561
|
-
var tokens = Tree.tokenize(this.code);
|
|
562
|
-
this._root = Tree.processTokens(tokens);
|
|
563
|
-
};
|
|
564
|
-
Tree.prototype.evaluate = function (scope, dom, tag) {
|
|
565
|
-
if (tag === void 0) { tag = null; }
|
|
566
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
567
|
-
var context, r;
|
|
568
|
-
return __generator(this, function (_a) {
|
|
569
|
-
switch (_a.label) {
|
|
570
|
-
case 0:
|
|
571
|
-
context = {
|
|
572
|
-
scope: scope,
|
|
573
|
-
dom: dom,
|
|
574
|
-
tag: tag,
|
|
575
|
-
tree: this
|
|
576
|
-
};
|
|
577
|
-
Tree.executing.add(context);
|
|
578
|
-
return [4 /*yield*/, this._root.evaluate(scope, dom, tag)];
|
|
579
|
-
case 1:
|
|
580
|
-
r = _a.sent();
|
|
581
|
-
Tree.executing.delete(context);
|
|
582
|
-
if (Tree.executing.size === 0)
|
|
583
|
-
setTimeout(function () {
|
|
584
|
-
DOM_1.DOM.instance.cleanup();
|
|
585
|
-
}, 1000);
|
|
586
|
-
return [2 /*return*/, r];
|
|
587
|
-
}
|
|
588
|
-
});
|
|
589
|
-
});
|
|
590
|
-
};
|
|
591
|
-
Tree.prototype.prepare = function (scope, dom, tag) {
|
|
592
|
-
if (tag === void 0) { tag = null; }
|
|
593
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
594
|
-
return __generator(this, function (_a) {
|
|
595
|
-
switch (_a.label) {
|
|
596
|
-
case 0:
|
|
597
|
-
if (!this._root.isPreparationRequired())
|
|
598
|
-
return [2 /*return*/];
|
|
599
|
-
return [4 /*yield*/, this._root.prepare(scope, dom, tag, {
|
|
600
|
-
initial: true
|
|
601
|
-
})];
|
|
602
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
|
-
});
|
|
606
|
-
};
|
|
607
|
-
Tree.prototype.bindToScopeChanges = function (scope, fnc, dom, tag) {
|
|
608
|
-
if (tag === void 0) { tag = null; }
|
|
609
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
610
|
-
var _a, _b, node, _scope, name_1, ref, ref_1, ref_1_1, tag_1, e_2_1;
|
|
611
|
-
var e_2, _c, e_3, _d;
|
|
612
|
-
return __generator(this, function (_e) {
|
|
613
|
-
switch (_e.label) {
|
|
614
|
-
case 0:
|
|
615
|
-
_e.trys.push([0, 8, 9, 10]);
|
|
616
|
-
_a = __values(this._root.findChildrenByTypes([RootScopeMemberNode_1.RootScopeMemberNode, ScopeMemberNode_1.ScopeMemberNode, ElementAttributeNode_1.ElementAttributeNode], 'ScopeMemberNodes')), _b = _a.next();
|
|
617
|
-
_e.label = 1;
|
|
618
|
-
case 1:
|
|
619
|
-
if (!!_b.done) return [3 /*break*/, 7];
|
|
620
|
-
node = _b.value;
|
|
621
|
-
_scope = scope;
|
|
622
|
-
return [4 /*yield*/, node.name.evaluate(scope, dom, tag)];
|
|
623
|
-
case 2:
|
|
624
|
-
name_1 = _e.sent();
|
|
625
|
-
if (!(node instanceof ScopeMemberNode_1.ScopeMemberNode)) return [3 /*break*/, 4];
|
|
626
|
-
return [4 /*yield*/, node.scope.evaluate(scope, dom)];
|
|
627
|
-
case 3:
|
|
628
|
-
_scope = _e.sent();
|
|
629
|
-
_scope.on("change:" + name_1, fnc);
|
|
630
|
-
return [3 /*break*/, 6];
|
|
631
|
-
case 4:
|
|
632
|
-
if (!(node instanceof ElementAttributeNode_1.ElementAttributeNode && node.elementRef)) return [3 /*break*/, 6];
|
|
633
|
-
return [4 /*yield*/, node.elementRef.evaluate(scope, dom, tag)];
|
|
634
|
-
case 5:
|
|
635
|
-
ref = _e.sent();
|
|
636
|
-
if (ref instanceof Tag_1.Tag) {
|
|
637
|
-
ref.scope.on("change:" + name_1, fnc);
|
|
638
|
-
}
|
|
639
|
-
else if (ref instanceof Array) {
|
|
640
|
-
try {
|
|
641
|
-
for (ref_1 = (e_3 = void 0, __values(ref)), ref_1_1 = ref_1.next(); !ref_1_1.done; ref_1_1 = ref_1.next()) {
|
|
642
|
-
tag_1 = ref_1_1.value;
|
|
643
|
-
tag_1.scope.on("change:" + name_1, fnc);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
647
|
-
finally {
|
|
648
|
-
try {
|
|
649
|
-
if (ref_1_1 && !ref_1_1.done && (_d = ref_1.return)) _d.call(ref_1);
|
|
650
|
-
}
|
|
651
|
-
finally { if (e_3) throw e_3.error; }
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
else {
|
|
655
|
-
console.warn("Cannot bind to changes for " + name_1 + ".");
|
|
656
|
-
}
|
|
657
|
-
_e.label = 6;
|
|
658
|
-
case 6:
|
|
659
|
-
_b = _a.next();
|
|
660
|
-
return [3 /*break*/, 1];
|
|
661
|
-
case 7: return [3 /*break*/, 10];
|
|
662
|
-
case 8:
|
|
663
|
-
e_2_1 = _e.sent();
|
|
664
|
-
e_2 = { error: e_2_1 };
|
|
665
|
-
return [3 /*break*/, 10];
|
|
666
|
-
case 9:
|
|
667
|
-
try {
|
|
668
|
-
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
669
|
-
}
|
|
670
|
-
finally { if (e_2) throw e_2.error; }
|
|
671
|
-
return [7 /*endfinally*/];
|
|
672
|
-
case 10: return [2 /*return*/];
|
|
673
|
-
}
|
|
674
|
-
});
|
|
675
|
-
});
|
|
676
|
-
};
|
|
677
|
-
Tree.reprepareExecutingTrees = function () {
|
|
678
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
679
|
-
var _a, _b, context, e_4_1;
|
|
680
|
-
var e_4, _c;
|
|
681
|
-
return __generator(this, function (_d) {
|
|
682
|
-
switch (_d.label) {
|
|
683
|
-
case 0:
|
|
684
|
-
_d.trys.push([0, 5, 6, 7]);
|
|
685
|
-
_a = __values(this.executing), _b = _a.next();
|
|
686
|
-
_d.label = 1;
|
|
687
|
-
case 1:
|
|
688
|
-
if (!!_b.done) return [3 /*break*/, 4];
|
|
689
|
-
context = _b.value;
|
|
690
|
-
return [4 /*yield*/, context.tree.prepare(context.scope, context.dom, context.tag)];
|
|
691
|
-
case 2:
|
|
692
|
-
_d.sent();
|
|
693
|
-
_d.label = 3;
|
|
694
|
-
case 3:
|
|
695
|
-
_b = _a.next();
|
|
696
|
-
return [3 /*break*/, 1];
|
|
697
|
-
case 4: return [3 /*break*/, 7];
|
|
698
|
-
case 5:
|
|
699
|
-
e_4_1 = _d.sent();
|
|
700
|
-
e_4 = { error: e_4_1 };
|
|
701
|
-
return [3 /*break*/, 7];
|
|
702
|
-
case 6:
|
|
703
|
-
try {
|
|
704
|
-
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
705
|
-
}
|
|
706
|
-
finally { if (e_4) throw e_4.error; }
|
|
707
|
-
return [7 /*endfinally*/];
|
|
708
|
-
case 7: return [2 /*return*/];
|
|
709
|
-
}
|
|
710
|
-
});
|
|
711
|
-
});
|
|
712
|
-
};
|
|
713
|
-
Tree.tokenize = function (code) {
|
|
714
|
-
var e_5, _a;
|
|
715
|
-
var tokens = [];
|
|
716
|
-
if (!code || code.length === 0)
|
|
717
|
-
return tokens;
|
|
718
|
-
var foundToken;
|
|
719
|
-
do {
|
|
720
|
-
foundToken = false;
|
|
721
|
-
try {
|
|
722
|
-
for (var TOKEN_PATTERNS_1 = (e_5 = void 0, __values(TOKEN_PATTERNS)), TOKEN_PATTERNS_1_1 = TOKEN_PATTERNS_1.next(); !TOKEN_PATTERNS_1_1.done; TOKEN_PATTERNS_1_1 = TOKEN_PATTERNS_1.next()) {
|
|
723
|
-
var tp = TOKEN_PATTERNS_1_1.value;
|
|
724
|
-
var match = tp.pattern.exec(code);
|
|
725
|
-
if (match) {
|
|
726
|
-
tokens.push({
|
|
727
|
-
type: tp.type,
|
|
728
|
-
value: match[match.length - 1],
|
|
729
|
-
full: match[0],
|
|
730
|
-
groups: match
|
|
731
|
-
});
|
|
732
|
-
code = code.substring(match[0].length);
|
|
733
|
-
foundToken = true;
|
|
734
|
-
break;
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
739
|
-
finally {
|
|
740
|
-
try {
|
|
741
|
-
if (TOKEN_PATTERNS_1_1 && !TOKEN_PATTERNS_1_1.done && (_a = TOKEN_PATTERNS_1.return)) _a.call(TOKEN_PATTERNS_1);
|
|
742
|
-
}
|
|
743
|
-
finally { if (e_5) throw e_5.error; }
|
|
744
|
-
}
|
|
745
|
-
} while (code.length > 0 && foundToken);
|
|
746
|
-
return tokens;
|
|
747
|
-
};
|
|
748
|
-
Tree.stripWhiteSpace = function (tokens) {
|
|
749
|
-
for (var i = 0; i < tokens.length; i++) {
|
|
750
|
-
if (tokens[i].type === TokenType.WHITESPACE) {
|
|
751
|
-
tokens.splice(i, 1);
|
|
752
|
-
i--;
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
return tokens;
|
|
756
|
-
};
|
|
757
|
-
Tree.processTokens = function (tokens, _node, _lastBlock) {
|
|
758
|
-
var e_6, _a;
|
|
759
|
-
if (_node === void 0) { _node = null; }
|
|
760
|
-
if (_lastBlock === void 0) { _lastBlock = null; }
|
|
761
|
-
var blockNodes = [];
|
|
762
|
-
var lastBlock = _lastBlock;
|
|
763
|
-
var node = _node;
|
|
764
|
-
var count = 0;
|
|
765
|
-
Tree.stripWhiteSpace(tokens);
|
|
766
|
-
while (tokens.length > 0) {
|
|
767
|
-
count++;
|
|
768
|
-
if (count > 1000)
|
|
769
|
-
break; // Limit to 1000 iterations while in development
|
|
770
|
-
if (tokens[0].type === TokenType.RETURN)
|
|
771
|
-
tokens.shift();
|
|
772
|
-
var token = tokens[0];
|
|
773
|
-
if (token.type === TokenType.NAME) {
|
|
774
|
-
node = new RootScopeMemberNode_1.RootScopeMemberNode(new LiteralNode_1.LiteralNode(token.value));
|
|
775
|
-
tokens.shift();
|
|
776
|
-
}
|
|
777
|
-
else if (XHRNode_1.XHRNode.match(tokens)) {
|
|
778
|
-
node = XHRNode_1.XHRNode.parse(node, tokens[0], tokens);
|
|
779
|
-
}
|
|
780
|
-
else if (token.type === TokenType.DISPATCH_EVENT) {
|
|
781
|
-
node = DispatchEventNode_1.DispatchEventNode.parse(node, tokens[0], tokens);
|
|
782
|
-
}
|
|
783
|
-
else if (token.type === TokenType.WITH) {
|
|
784
|
-
node = WithNode_1.WithNode.parse(node, tokens[0], tokens);
|
|
785
|
-
lastBlock = node;
|
|
786
|
-
blockNodes.push(node);
|
|
787
|
-
node = null;
|
|
788
|
-
}
|
|
789
|
-
else if (token.type === TokenType.NAMED_STACK) {
|
|
790
|
-
node = NamedStackNode_1.NamedStackNode.parse(node, tokens[0], tokens);
|
|
791
|
-
lastBlock = node;
|
|
792
|
-
blockNodes.push(node);
|
|
793
|
-
node = null;
|
|
794
|
-
}
|
|
795
|
-
else if (token.type === TokenType.AS) {
|
|
796
|
-
node = AsNode_1.AsNode.parse(node, tokens[0], tokens);
|
|
797
|
-
}
|
|
798
|
-
else if (token.type === TokenType.IF) {
|
|
799
|
-
node = IfStatementNode_1.IfStatementNode.parse(node, token, tokens);
|
|
800
|
-
lastBlock = node;
|
|
801
|
-
blockNodes.push(node);
|
|
802
|
-
node = null;
|
|
803
|
-
}
|
|
804
|
-
else if (token.type === TokenType.FOR) {
|
|
805
|
-
node = ForStatementNode_1.ForStatementNode.parse(node, token, tokens);
|
|
806
|
-
lastBlock = node;
|
|
807
|
-
blockNodes.push(node);
|
|
808
|
-
node = null;
|
|
809
|
-
}
|
|
810
|
-
else if (token.type === TokenType.FUNC) {
|
|
811
|
-
node = FunctionNode_1.FunctionNode.parse(node, token, tokens);
|
|
812
|
-
lastBlock = node;
|
|
813
|
-
blockNodes.push(node);
|
|
814
|
-
node = null;
|
|
815
|
-
}
|
|
816
|
-
else if (token.type === TokenType.LOOP) {
|
|
817
|
-
node = LoopNode_1.LoopNode.parse(node, token, tokens);
|
|
818
|
-
lastBlock = node;
|
|
819
|
-
blockNodes.push(node);
|
|
820
|
-
node = null;
|
|
821
|
-
}
|
|
822
|
-
else if (token.type === TokenType.ON) {
|
|
823
|
-
node = OnNode_1.OnNode.parse(node, token, tokens);
|
|
824
|
-
lastBlock = node;
|
|
825
|
-
blockNodes.push(node);
|
|
826
|
-
node = null;
|
|
827
|
-
}
|
|
828
|
-
else if (token.type === TokenType.CLASS) {
|
|
829
|
-
node = ClassNode_1.ClassNode.parse(node, token, tokens);
|
|
830
|
-
lastBlock = node;
|
|
831
|
-
blockNodes.push(node);
|
|
832
|
-
node = null;
|
|
833
|
-
}
|
|
834
|
-
else if (StringFormatNode_1.StringFormatNode.match(tokens)) {
|
|
835
|
-
node = StringFormatNode_1.StringFormatNode.parse(node, tokens[0], tokens);
|
|
836
|
-
}
|
|
837
|
-
else if (token.type === TokenType.STRING_LITERAL) {
|
|
838
|
-
node = new LiteralNode_1.LiteralNode(token.value);
|
|
839
|
-
tokens.shift();
|
|
840
|
-
}
|
|
841
|
-
else if (token.type === TokenType.NUMBER_LITERAL) {
|
|
842
|
-
node = new NumberLiteralNode_1.NumberLiteralNode(token.value);
|
|
843
|
-
tokens.shift();
|
|
844
|
-
}
|
|
845
|
-
else if (tokens[0].type === TokenType.ELEMENT_REFERENCE) {
|
|
846
|
-
node = new ElementQueryNode_1.ElementQueryNode(tokens[0].value, true);
|
|
847
|
-
tokens.shift();
|
|
848
|
-
}
|
|
849
|
-
else if (tokens[0].type === TokenType.ELEMENT_QUERY) {
|
|
850
|
-
node = ElementQueryNode_1.ElementQueryNode.parse(node, tokens[0], tokens);
|
|
851
|
-
}
|
|
852
|
-
else if (tokens[0].type === TokenType.L_BRACKET) {
|
|
853
|
-
if (node) {
|
|
854
|
-
node = IndexNode_1.IndexNode.parse(node, token, tokens);
|
|
855
|
-
}
|
|
856
|
-
else {
|
|
857
|
-
node = ArrayNode_1.ArrayNode.parse(node, token, tokens);
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
else if (tokens[0].type === TokenType.L_BRACE) {
|
|
861
|
-
node = ObjectNode_1.ObjectNode.parse(node, token, tokens);
|
|
862
|
-
}
|
|
863
|
-
else if (tokens[0].type === TokenType.ELEMENT_ATTRIBUTE) {
|
|
864
|
-
node = new ElementAttributeNode_1.ElementAttributeNode(node, tokens[0].value);
|
|
865
|
-
tokens.shift();
|
|
866
|
-
}
|
|
867
|
-
else if (tokens[0].type === TokenType.ELEMENT_STYLE) {
|
|
868
|
-
node = new ElementStyleNode_1.ElementStyleNode(node, tokens[0].value);
|
|
869
|
-
tokens.shift();
|
|
870
|
-
}
|
|
871
|
-
else if (node !== null && token.type === TokenType.PERIOD && tokens[1].type === TokenType.NAME) {
|
|
872
|
-
node = new ScopeMemberNode_1.ScopeMemberNode(node, new LiteralNode_1.LiteralNode(tokens[1].value));
|
|
873
|
-
tokens.splice(0, 2);
|
|
874
|
-
}
|
|
875
|
-
else if (tokens[0].type === TokenType.L_PAREN) {
|
|
876
|
-
var funcArgs = Tree.getBlockTokens(tokens);
|
|
877
|
-
var nodes = [];
|
|
878
|
-
try {
|
|
879
|
-
for (var funcArgs_1 = (e_6 = void 0, __values(funcArgs)), funcArgs_1_1 = funcArgs_1.next(); !funcArgs_1_1.done; funcArgs_1_1 = funcArgs_1.next()) {
|
|
880
|
-
var arg = funcArgs_1_1.value;
|
|
881
|
-
nodes.push(Tree.processTokens(arg));
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
885
|
-
finally {
|
|
886
|
-
try {
|
|
887
|
-
if (funcArgs_1_1 && !funcArgs_1_1.done && (_a = funcArgs_1.return)) _a.call(funcArgs_1);
|
|
888
|
-
}
|
|
889
|
-
finally { if (e_6) throw e_6.error; }
|
|
890
|
-
}
|
|
891
|
-
if (node) {
|
|
892
|
-
node = new FunctionCallNode_1.FunctionCallNode(node, // Previous node should be a NAME
|
|
893
|
-
new FunctionArgumentNode_1.FunctionArgumentNode(nodes));
|
|
894
|
-
}
|
|
895
|
-
else {
|
|
896
|
-
node = new BlockNode_1.BlockNode(nodes);
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
else if (tokens[0].type === TokenType.SEMICOLON) {
|
|
900
|
-
if (node) {
|
|
901
|
-
blockNodes.push(node);
|
|
902
|
-
}
|
|
903
|
-
node = null;
|
|
904
|
-
tokens.shift();
|
|
905
|
-
}
|
|
906
|
-
else if (InNode_1.InNode.match(tokens)) {
|
|
907
|
-
node = InNode_1.InNode.parse(node, token, tokens);
|
|
908
|
-
}
|
|
909
|
-
else if (ComparisonNode_1.ComparisonNode.match(tokens)) {
|
|
910
|
-
node = ComparisonNode_1.ComparisonNode.parse(node, token, tokens);
|
|
911
|
-
}
|
|
912
|
-
else if (ArithmeticNode_1.ArithmeticNode.match(tokens)) {
|
|
913
|
-
node = ArithmeticNode_1.ArithmeticNode.parse(node, token, tokens);
|
|
914
|
-
}
|
|
915
|
-
else if (AssignmentNode_1.AssignmentNode.match(tokens)) {
|
|
916
|
-
node = AssignmentNode_1.AssignmentNode.parse(node, token, tokens);
|
|
917
|
-
}
|
|
918
|
-
else if (tokens[0].type === TokenType.WHITESPACE) {
|
|
919
|
-
tokens.shift();
|
|
920
|
-
}
|
|
921
|
-
else if (tokens[0].type === TokenType.UNIT) {
|
|
922
|
-
node = new UnitLiteralNode_1.UnitLiteralNode(tokens[0].value);
|
|
923
|
-
tokens.shift();
|
|
924
|
-
}
|
|
925
|
-
else if (tokens[0].type === TokenType.BOOLEAN_LITERAL) {
|
|
926
|
-
node = new BooleanLiteralNode_1.BooleanLiteralNode(tokens[0].value);
|
|
927
|
-
tokens.shift();
|
|
928
|
-
}
|
|
929
|
-
else if (tokens[0].type === TokenType.NULL_LITERAL) {
|
|
930
|
-
node = new LiteralNode_1.LiteralNode(null);
|
|
931
|
-
tokens.shift();
|
|
932
|
-
}
|
|
933
|
-
else if (tokens[0].type === TokenType.EXCLAMATION_POINT) {
|
|
934
|
-
node = NotNode_1.NotNode.parse(node, tokens[0], tokens);
|
|
935
|
-
}
|
|
936
|
-
else if (tokens[0].type === TokenType.MODIFIER) {
|
|
937
|
-
ModifierNode_1.ModifierNode.parse(node ? node : lastBlock, tokens[0], tokens);
|
|
938
|
-
}
|
|
939
|
-
else {
|
|
940
|
-
var code = Tree.toCode(tokens, 10);
|
|
941
|
-
throw Error("Syntax Error. Near " + code);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
if (node) {
|
|
945
|
-
blockNodes.push(node);
|
|
946
|
-
}
|
|
947
|
-
return new BlockNode_1.BlockNode(blockNodes);
|
|
948
|
-
};
|
|
949
|
-
Tree.toCode = function (tokens, limit) {
|
|
950
|
-
var code = '';
|
|
951
|
-
limit = limit || tokens.length;
|
|
952
|
-
for (var i = 0; i < limit; i++) {
|
|
953
|
-
if (!tokens[i])
|
|
954
|
-
break;
|
|
955
|
-
code += tokens[i].value;
|
|
956
|
-
}
|
|
957
|
-
return code;
|
|
958
|
-
};
|
|
959
|
-
Tree.getBlockInfo = function (tokens) {
|
|
960
|
-
var blockType;
|
|
961
|
-
var opener = tokens[0];
|
|
962
|
-
if (opener.type === TokenType.L_PAREN)
|
|
963
|
-
blockType = BlockType.PAREN;
|
|
964
|
-
else if (opener.type === TokenType.L_BRACE)
|
|
965
|
-
blockType = BlockType.BRACE;
|
|
966
|
-
else if (opener.type === TokenType.L_BRACKET)
|
|
967
|
-
blockType = BlockType.BRACKET;
|
|
968
|
-
else
|
|
969
|
-
blockType = BlockType.STATEMENT;
|
|
970
|
-
var open;
|
|
971
|
-
var close;
|
|
972
|
-
var openCharacter;
|
|
973
|
-
var closeCharacter;
|
|
974
|
-
switch (blockType) {
|
|
975
|
-
case BlockType.PAREN:
|
|
976
|
-
open = TokenType.L_PAREN;
|
|
977
|
-
close = TokenType.R_PAREN;
|
|
978
|
-
openCharacter = '(';
|
|
979
|
-
closeCharacter = ')';
|
|
980
|
-
break;
|
|
981
|
-
case BlockType.BRACE:
|
|
982
|
-
open = TokenType.L_BRACE;
|
|
983
|
-
close = TokenType.R_BRACE;
|
|
984
|
-
openCharacter = '{';
|
|
985
|
-
closeCharacter = '}';
|
|
986
|
-
break;
|
|
987
|
-
case BlockType.BRACKET:
|
|
988
|
-
open = TokenType.L_BRACKET;
|
|
989
|
-
close = TokenType.R_BRACKET;
|
|
990
|
-
openCharacter = '[';
|
|
991
|
-
closeCharacter = ']';
|
|
992
|
-
break;
|
|
993
|
-
default:
|
|
994
|
-
open = null;
|
|
995
|
-
close = TokenType.SEMICOLON;
|
|
996
|
-
openCharacter = null;
|
|
997
|
-
closeCharacter = ';';
|
|
998
|
-
break;
|
|
999
|
-
}
|
|
1000
|
-
return {
|
|
1001
|
-
type: blockType,
|
|
1002
|
-
open: open,
|
|
1003
|
-
close: close,
|
|
1004
|
-
openCharacter: openCharacter,
|
|
1005
|
-
closeCharacter: closeCharacter
|
|
1006
|
-
};
|
|
1007
|
-
};
|
|
1008
|
-
Tree.getNextStatementTokens = function (tokens, consumeClosingToken, consumeOpeningToken, includeClosingToken) {
|
|
1009
|
-
if (consumeClosingToken === void 0) { consumeClosingToken = true; }
|
|
1010
|
-
if (consumeOpeningToken === void 0) { consumeOpeningToken = true; }
|
|
1011
|
-
if (includeClosingToken === void 0) { includeClosingToken = false; }
|
|
1012
|
-
var blockInfo = Tree.getBlockInfo(tokens);
|
|
1013
|
-
// Consume opening block token
|
|
1014
|
-
if (consumeOpeningToken && tokens[0].type === blockInfo.open) {
|
|
1015
|
-
tokens.shift();
|
|
1016
|
-
}
|
|
1017
|
-
return Tree.getTokensUntil(tokens, blockInfo.close, consumeClosingToken, includeClosingToken);
|
|
1018
|
-
};
|
|
1019
|
-
Tree.getBlockTokens = function (tokens, groupBy) {
|
|
1020
|
-
if (groupBy === void 0) { groupBy = TokenType.COMMA; }
|
|
1021
|
-
var blockInfo = Tree.getBlockInfo(tokens);
|
|
1022
|
-
var args = [];
|
|
1023
|
-
var arg = [];
|
|
1024
|
-
var isOpen = true;
|
|
1025
|
-
// consume opener
|
|
1026
|
-
tokens.shift();
|
|
1027
|
-
while (isOpen) {
|
|
1028
|
-
var token = tokens[0];
|
|
1029
|
-
if (token === undefined)
|
|
1030
|
-
throw Error("Invalid Syntax, missing " + blockInfo.closeCharacter);
|
|
1031
|
-
if (token.type === blockInfo.close) {
|
|
1032
|
-
isOpen = false;
|
|
1033
|
-
tokens.shift();
|
|
1034
|
-
//arg.push(token);
|
|
1035
|
-
}
|
|
1036
|
-
else if (tokenIsBlockOpener(token.type)) {
|
|
1037
|
-
var opener_1 = tokens.shift();
|
|
1038
|
-
var innerBlock = Tree.getTokensUntil(tokens, getTokenBlockOpenerConfig(token.type).close, true, true);
|
|
1039
|
-
innerBlock.unshift(opener_1);
|
|
1040
|
-
arg.push.apply(arg, __spreadArray([], __read(innerBlock)));
|
|
1041
|
-
//args.push(innerBlock);
|
|
1042
|
-
}
|
|
1043
|
-
else if (groupBy !== null && token.type === groupBy) {
|
|
1044
|
-
args.push(arg);
|
|
1045
|
-
arg = [];
|
|
1046
|
-
tokens.shift();
|
|
1047
|
-
}
|
|
1048
|
-
else if (token.type !== TokenType.WHITESPACE) {
|
|
1049
|
-
arg.push(tokens.shift());
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
if (arg.length > 0)
|
|
1053
|
-
args.push(arg);
|
|
1054
|
-
return args;
|
|
1055
|
-
};
|
|
1056
|
-
Tree.getTokensUntil = function (tokens, terminator, consumeTerminator, includeTerminator, validIfTerminatorNotFound, blockInfo) {
|
|
1057
|
-
if (terminator === void 0) { terminator = TokenType.SEMICOLON; }
|
|
1058
|
-
if (consumeTerminator === void 0) { consumeTerminator = true; }
|
|
1059
|
-
if (includeTerminator === void 0) { includeTerminator = false; }
|
|
1060
|
-
if (validIfTerminatorNotFound === void 0) { validIfTerminatorNotFound = false; }
|
|
1061
|
-
if (blockInfo === void 0) { blockInfo = null; }
|
|
1062
|
-
var statementTokens = [];
|
|
1063
|
-
blockInfo = blockInfo || Tree.getBlockInfo(tokens);
|
|
1064
|
-
var openParens = 0;
|
|
1065
|
-
var openBraces = 0;
|
|
1066
|
-
var openBrackets = 0;
|
|
1067
|
-
for (var i = 0; i < tokens.length; i++) {
|
|
1068
|
-
var token = tokens[i];
|
|
1069
|
-
if (!(token.type === blockInfo.open && i === 0)) { // Skip opener
|
|
1070
|
-
if (token.type === TokenType.L_PAREN && terminator !== TokenType.L_PAREN)
|
|
1071
|
-
openParens += 1;
|
|
1072
|
-
if (token.type === TokenType.L_BRACE && terminator !== TokenType.L_BRACE)
|
|
1073
|
-
openBraces += 1;
|
|
1074
|
-
if (token.type === TokenType.L_BRACKET && terminator !== TokenType.L_BRACKET)
|
|
1075
|
-
openBrackets += 1;
|
|
1076
|
-
}
|
|
1077
|
-
if ([
|
|
1078
|
-
terminator,
|
|
1079
|
-
TokenType.R_BRACKET,
|
|
1080
|
-
TokenType.R_BRACE,
|
|
1081
|
-
TokenType.R_PAREN
|
|
1082
|
-
].indexOf(token.type) > -1) {
|
|
1083
|
-
if (openParens > 0 && token.type === TokenType.R_PAREN) {
|
|
1084
|
-
openParens -= 1;
|
|
1085
|
-
}
|
|
1086
|
-
else if (openBraces > 0 && token.type === TokenType.R_BRACE) {
|
|
1087
|
-
openBraces -= 1;
|
|
1088
|
-
}
|
|
1089
|
-
else if (openBrackets > 0 && token.type === TokenType.R_BRACKET) {
|
|
1090
|
-
openBrackets -= 1;
|
|
1091
|
-
}
|
|
1092
|
-
else if (token.type === terminator && openParens === 0 && openBraces === 0 && openBrackets === 0) {
|
|
1093
|
-
if (includeTerminator)
|
|
1094
|
-
statementTokens.push(token);
|
|
1095
|
-
//if (consumeTerminator && token.type !== TokenType.SEMICOLON)
|
|
1096
|
-
if ((includeTerminator || consumeTerminator) && token.type !== TokenType.SEMICOLON)
|
|
1097
|
-
tokens.shift(); // Consume end of block
|
|
1098
|
-
break;
|
|
1099
|
-
}
|
|
1100
|
-
else if (token.type === terminator && (openParens > 0 || openBraces > 0 || openBrackets > 0)) {
|
|
1101
|
-
}
|
|
1102
|
-
else {
|
|
1103
|
-
if (validIfTerminatorNotFound)
|
|
1104
|
-
break;
|
|
1105
|
-
throw Error("Invalid syntax, expecting " + terminator + ".");
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
statementTokens.push(token);
|
|
1109
|
-
tokens.shift(); // Consume part of statement
|
|
1110
|
-
i--;
|
|
1111
|
-
}
|
|
1112
|
-
return statementTokens;
|
|
1113
|
-
};
|
|
1114
|
-
Tree.consumeTypes = function (tokens, types) {
|
|
1115
|
-
var e_7, _a;
|
|
1116
|
-
var matching = [];
|
|
1117
|
-
try {
|
|
1118
|
-
for (var tokens_1 = __values(tokens), tokens_1_1 = tokens_1.next(); !tokens_1_1.done; tokens_1_1 = tokens_1.next()) {
|
|
1119
|
-
var token = tokens_1_1.value;
|
|
1120
|
-
if (types.indexOf(token.type) > -1) {
|
|
1121
|
-
matching.push(token);
|
|
1122
|
-
}
|
|
1123
|
-
else {
|
|
1124
|
-
break;
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1129
|
-
finally {
|
|
1130
|
-
try {
|
|
1131
|
-
if (tokens_1_1 && !tokens_1_1.done && (_a = tokens_1.return)) _a.call(tokens_1);
|
|
1132
|
-
}
|
|
1133
|
-
finally { if (e_7) throw e_7.error; }
|
|
1134
|
-
}
|
|
1135
|
-
tokens.splice(0, matching.length);
|
|
1136
|
-
return matching;
|
|
1137
|
-
};
|
|
1138
|
-
Tree.apply = function (code, scope, dom, tag) {
|
|
1139
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1140
|
-
var t;
|
|
1141
|
-
return __generator(this, function (_a) {
|
|
1142
|
-
switch (_a.label) {
|
|
1143
|
-
case 0:
|
|
1144
|
-
t = new Tree(code);
|
|
1145
|
-
return [4 /*yield*/, t.evaluate(scope, dom, tag)];
|
|
1146
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
1147
|
-
}
|
|
1148
|
-
});
|
|
1149
|
-
});
|
|
1150
|
-
};
|
|
1151
|
-
Tree.executing = new Set();
|
|
1152
|
-
Tree.cache = new TreeCache();
|
|
1153
|
-
return Tree;
|
|
1154
|
-
}());
|
|
1155
|
-
exports.Tree = Tree;
|
|
1156
|
-
//# sourceMappingURL=AST.js.map
|