@lcap/nasl 3.3.3-beta.6 → 3.3.3-beta.7
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/out/bak/translator.js +73 -15
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +11 -0
- package/out/common/BaseNode.js +51 -0
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/index.d.ts +1 -0
- package/out/common/index.js +1 -0
- package/out/common/index.js.map +1 -1
- package/out/common/utils.d.ts +2 -0
- package/out/common/utils.js +18 -0
- package/out/common/utils.js.map +1 -0
- package/out/concepts/Abort__.d.ts +2 -2
- package/out/concepts/Abort__.js +6 -2
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +2 -2
- package/out/concepts/Anchor__.js +11 -7
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +3 -3
- package/out/concepts/AnonymousFunction__.js +37 -23
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +137 -69
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +2 -2
- package/out/concepts/Argument__.js +18 -13
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +2 -2
- package/out/concepts/Assignee__.js +31 -19
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.d.ts +2 -2
- package/out/concepts/AssignmentLine__.js +3 -2
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +2 -2
- package/out/concepts/Assignment__.js +16 -12
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +6 -3
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +2 -2
- package/out/concepts/AuthLogicForCallInterface__.js +62 -78
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +5 -8
- package/out/concepts/BackendVariable__.js +23 -18
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +4 -7
- package/out/concepts/Backend__.js +16 -11
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +2 -2
- package/out/concepts/BatchAssignment__.js +30 -22
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +2 -2
- package/out/concepts/BinaryExpression__.js +30 -18
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +10 -4
- package/out/concepts/BindAttribute__.js +144 -43
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +2 -2
- package/out/concepts/BindDirective__.js +16 -11
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +4 -7
- package/out/concepts/BindEvent__.js +32 -24
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +2 -2
- package/out/concepts/BindStyle__.js +15 -10
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +2 -2
- package/out/concepts/BooleanLiteral__.js +2 -2
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +2 -2
- package/out/concepts/CallAuthInterface__.js +36 -31
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +2 -2
- package/out/concepts/CallConnector__.js +25 -23
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +2 -2
- package/out/concepts/CallFunction__.js +31 -22
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -2
- package/out/concepts/CallInterface__.js +20 -29
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +2 -3
- package/out/concepts/CallLogic__.js +47 -50
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +4 -4
- package/out/concepts/CallQueryComponent__.js +50 -42
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.d.ts +2 -2
- package/out/concepts/Comment__.js +3 -2
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +6 -3
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +6 -3
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +4 -7
- package/out/concepts/ConfigProperty__.js +18 -13
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +6 -3
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +4 -7
- package/out/concepts/Connection__.js +12 -8
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/Connector__.js +30 -15
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +3 -3
- package/out/concepts/Constant__.js +18 -13
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +4 -7
- package/out/concepts/DataSource__.js +13 -9
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +3 -3
- package/out/concepts/Destination__.js +35 -29
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +2 -2
- package/out/concepts/End__.js +17 -13
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +2 -2
- package/out/concepts/EntityIndex__.js +4 -3
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +2 -2
- package/out/concepts/EntityProperty__.js +22 -15
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +4 -7
- package/out/concepts/Entity__.js +29 -21
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +2 -2
- package/out/concepts/EnumItem__.js +4 -3
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +4 -7
- package/out/concepts/Enum__.js +16 -11
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +6 -3
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +2 -2
- package/out/concepts/ExternalDestination__.js +13 -8
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +2 -2
- package/out/concepts/ForEachStatement__.js +26 -18
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js +18 -10
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +4 -7
- package/out/concepts/Frontend__.js +37 -21
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.d.ts +3 -3
- package/out/concepts/Function__.js +52 -33
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -2
- package/out/concepts/Identifier__.js +19 -18
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +2 -2
- package/out/concepts/IfStatement__.js +18 -13
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.js +17 -9
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +2 -2
- package/out/concepts/InterfaceParam__.js +12 -8
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +4 -7
- package/out/concepts/Interface__.js +44 -33
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +2 -2
- package/out/concepts/JSBlock__.js +3 -2
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +2 -2
- package/out/concepts/JavaLogic__.js +6 -2
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -2
- package/out/concepts/LogicItem__.js +7 -3
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +8 -11
- package/out/concepts/Logic__.js +141 -136
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +2 -2
- package/out/concepts/MatchCase__.js +35 -27
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +2 -2
- package/out/concepts/Match__.js +29 -24
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +2 -2
- package/out/concepts/MemberExpression__.js +34 -27
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +4 -7
- package/out/concepts/MetadataType__.js +23 -15
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.js +6 -3
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.js +6 -3
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.js +66 -33
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +5 -5
- package/out/concepts/NewComposite__.js +95 -82
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +5 -5
- package/out/concepts/NewList__.js +42 -32
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +4 -4
- package/out/concepts/NewMap__.js +51 -41
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.d.ts +2 -2
- package/out/concepts/New__.js +3 -2
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +2 -2
- package/out/concepts/NullLiteral__.js +2 -2
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +2 -2
- package/out/concepts/NumericLiteral__.js +12 -7
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +2 -2
- package/out/concepts/OqlQueryComponent__.js +22 -17
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +8 -11
- package/out/concepts/OverriddenLogic__.js +135 -130
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.d.ts +3 -3
- package/out/concepts/Param__.js +29 -24
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +12 -6
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +2 -2
- package/out/concepts/ProcessElement__.js +92 -66
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +2 -1
- package/out/concepts/ProcessOutcome__.js +5 -4
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +2 -1
- package/out/concepts/ProcessOutcomes__.js +6 -5
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.d.ts +4 -7
- package/out/concepts/Process__.js +51 -34
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.d.ts +2 -2
- package/out/concepts/QueryAggregateExpression__.js +8 -5
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +2 -2
- package/out/concepts/QueryFieldExpression__.js +5 -4
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +2 -2
- package/out/concepts/QueryFromExpression__.js +14 -9
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +2 -1
- package/out/concepts/QueryGroupByExpression__.js +12 -8
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +2 -2
- package/out/concepts/QueryJoinExpression__.js +18 -13
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +2 -2
- package/out/concepts/QueryLimitExpression__.js +12 -8
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +2 -2
- package/out/concepts/QueryOrderByExpression__.js +12 -8
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +6 -3
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +3 -3
- package/out/concepts/Return__.js +21 -16
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +4 -7
- package/out/concepts/Role__.js +7 -6
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +2 -2
- package/out/concepts/SelectMembers__.js +9 -5
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js +6 -3
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +2 -2
- package/out/concepts/SqlQueryComponent__.js +18 -13
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +2 -2
- package/out/concepts/Start__.js +2 -2
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +2 -2
- package/out/concepts/StringInterpolation__.js +13 -8
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +2 -2
- package/out/concepts/StringLiteral__.js +4 -3
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +2 -2
- package/out/concepts/StructureProperty__.js +14 -10
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +4 -7
- package/out/concepts/Structure__.js +22 -14
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +2 -2
- package/out/concepts/SwitchCase__.js +18 -13
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.d.ts +2 -2
- package/out/concepts/SwitchStatement__.js +14 -9
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TriggerEvent__.js +6 -3
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +4 -7
- package/out/concepts/TriggerLauncher__.js +7 -6
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +2 -2
- package/out/concepts/TypeAnnotation__.js +61 -29
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +2 -2
- package/out/concepts/TypeParam__.js +4 -3
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +2 -2
- package/out/concepts/UnaryExpression__.js +18 -10
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +2 -1
- package/out/concepts/Unparsed__.js +2 -2
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +2 -2
- package/out/concepts/ValidationRule__.js +17 -12
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +5 -8
- package/out/concepts/Variable__.js +23 -18
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +7 -6
- package/out/concepts/ViewElement__.js +139 -101
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +8 -9
- package/out/concepts/View__.js +73 -62
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +2 -2
- package/out/concepts/WhileStatement__.js +9 -7
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/manager/diagnostic.d.ts +1 -1
- package/out/manager/diagnostic.js +2 -3
- package/out/manager/diagnostic.js.map +1 -1
- package/out/server/naslServer.d.ts +46 -55
- package/out/server/naslServer.js +302 -449
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +1 -1
- package/out/server/translator.js.map +1 -1
- package/out/templator/genCreateBlock.js +4 -4
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +6 -6
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -4
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +2 -2
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +4 -4
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/translator/types.d.ts +16 -3
- package/out/translator/utils.d.ts +19 -1
- package/out/translator/utils.js +71 -2
- package/out/translator/utils.js.map +1 -1
- package/out/utils/time-slicing/constant.d.ts +35 -0
- package/out/utils/time-slicing/constant.js +40 -0
- package/out/utils/time-slicing/constant.js.map +1 -0
- package/out/utils/time-slicing/controller.d.ts +53 -0
- package/out/utils/time-slicing/controller.js +280 -0
- package/out/utils/time-slicing/controller.js.map +1 -0
- package/out/utils/time-slicing/index.d.ts +5 -0
- package/out/utils/time-slicing/index.js +26 -0
- package/out/utils/time-slicing/index.js.map +1 -0
- package/out/utils/time-slicing/page-state.d.ts +2 -0
- package/out/utils/time-slicing/page-state.js +14 -0
- package/out/utils/time-slicing/page-state.js.map +1 -0
- package/out/utils/time-slicing/performance.d.ts +11 -0
- package/out/utils/time-slicing/performance.js +51 -0
- package/out/utils/time-slicing/performance.js.map +1 -0
- package/out/utils/time-slicing/runner.d.ts +12 -0
- package/out/utils/time-slicing/runner.js +53 -0
- package/out/utils/time-slicing/runner.js.map +1 -0
- package/out/utils/time-slicing/tool.d.ts +24 -0
- package/out/utils/time-slicing/tool.js +47 -0
- package/out/utils/time-slicing/tool.js.map +1 -0
- package/out/utils/time-slicing/utils.d.ts +62 -0
- package/out/utils/time-slicing/utils.js +47 -0
- package/out/utils/time-slicing/utils.js.map +1 -0
- package/out/utils/time-slicing/wrapper.d.ts +18 -0
- package/out/utils/time-slicing/wrapper.js +55 -0
- package/out/utils/time-slicing/wrapper.js.map +1 -0
- package/out/utils/types.d.ts +7 -0
- package/package.json +1 -1
- package/src/bak/translator.js +75 -16
- package/src/common/BaseNode.ts +67 -6
- package/src/common/index.ts +1 -0
- package/src/common/utils.ts +17 -0
- package/src/concepts/Abort__.ts +12 -3
- package/src/concepts/Anchor__.ts +21 -8
- package/src/concepts/AnonymousFunction__.ts +45 -31
- package/src/concepts/App__.ts +137 -69
- package/src/concepts/Argument__.ts +31 -14
- package/src/concepts/Assignee__.ts +42 -21
- package/src/concepts/AssignmentLine__.ts +13 -3
- package/src/concepts/Assignment__.ts +26 -14
- package/src/concepts/Attribute__.ts +6 -3
- package/src/concepts/AuthLogicForCallInterface__.ts +69 -87
- package/src/concepts/BackendVariable__.ts +34 -19
- package/src/concepts/Backend__.ts +33 -12
- package/src/concepts/BatchAssignment__.ts +41 -23
- package/src/concepts/BinaryExpression__.ts +40 -20
- package/src/concepts/BindAttribute__.ts +151 -49
- package/src/concepts/BindDirective__.ts +25 -12
- package/src/concepts/BindEvent__.ts +43 -32
- package/src/concepts/BindStyle__.ts +24 -11
- package/src/concepts/BooleanLiteral__.ts +11 -3
- package/src/concepts/CallAuthInterface__.ts +45 -34
- package/src/concepts/CallConnector__.ts +34 -26
- package/src/concepts/CallFunction__.ts +34 -23
- package/src/concepts/CallInterface__.ts +33 -42
- package/src/concepts/CallLogic__.ts +60 -67
- package/src/concepts/CallQueryComponent__.ts +60 -52
- package/src/concepts/Comment__.ts +13 -3
- package/src/concepts/CompletionProperty__.ts +6 -3
- package/src/concepts/ConfigGroup__.ts +6 -3
- package/src/concepts/ConfigProperty__.ts +28 -15
- package/src/concepts/Configuration__.ts +6 -3
- package/src/concepts/Connection__.ts +28 -9
- package/src/concepts/Connector__.ts +30 -15
- package/src/concepts/Constant__.ts +28 -14
- package/src/concepts/DataSource__.ts +22 -10
- package/src/concepts/Destination__.ts +45 -36
- package/src/concepts/End__.ts +24 -15
- package/src/concepts/EntityIndex__.ts +13 -4
- package/src/concepts/EntityProperty__.ts +33 -17
- package/src/concepts/Entity__.ts +40 -25
- package/src/concepts/EnumItem__.ts +13 -4
- package/src/concepts/Enum__.ts +27 -13
- package/src/concepts/Event__.ts +6 -3
- package/src/concepts/ExternalDestination__.ts +22 -10
- package/src/concepts/ForEachStatement__.ts +36 -20
- package/src/concepts/FrontendLibrary__.ts +18 -10
- package/src/concepts/Frontend__.ts +48 -22
- package/src/concepts/Function__.ts +60 -36
- package/src/concepts/Identifier__.ts +28 -23
- package/src/concepts/IfStatement__.ts +28 -17
- package/src/concepts/Integration__.ts +17 -9
- package/src/concepts/InterfaceParam__.ts +22 -9
- package/src/concepts/Interface__.ts +55 -37
- package/src/concepts/JSBlock__.ts +12 -3
- package/src/concepts/JavaLogic__.ts +13 -3
- package/src/concepts/LogicItem__.ts +13 -4
- package/src/concepts/Logic__.ts +159 -149
- package/src/concepts/MatchCase__.ts +45 -32
- package/src/concepts/Match__.ts +39 -28
- package/src/concepts/MemberExpression__.ts +43 -28
- package/src/concepts/MetadataType__.ts +34 -16
- package/src/concepts/MsgTriggerEvent__.ts +6 -3
- package/src/concepts/MsgTriggerLauncher__.ts +6 -3
- package/src/concepts/Namespace__.ts +66 -33
- package/src/concepts/NewComposite__.ts +106 -87
- package/src/concepts/NewList__.ts +52 -38
- package/src/concepts/NewMap__.ts +61 -48
- package/src/concepts/New__.ts +13 -3
- package/src/concepts/NullLiteral__.ts +11 -3
- package/src/concepts/NumericLiteral__.ts +21 -8
- package/src/concepts/OqlQueryComponent__.ts +32 -21
- package/src/concepts/OverriddenLogic__.ts +153 -143
- package/src/concepts/Param__.ts +48 -34
- package/src/concepts/ProcessComponent__.ts +12 -6
- package/src/concepts/ProcessElement__.ts +102 -76
- package/src/concepts/ProcessOutcome__.ts +16 -8
- package/src/concepts/ProcessOutcomes__.ts +17 -9
- package/src/concepts/Process__.ts +62 -41
- package/src/concepts/QueryAggregateExpression__.ts +17 -6
- package/src/concepts/QueryFieldExpression__.ts +14 -5
- package/src/concepts/QueryFromExpression__.ts +24 -10
- package/src/concepts/QueryGroupByExpression__.ts +20 -9
- package/src/concepts/QueryJoinExpression__.ts +28 -14
- package/src/concepts/QueryLimitExpression__.ts +22 -9
- package/src/concepts/QueryOrderByExpression__.ts +23 -9
- package/src/concepts/QuerySelectExpression__.ts +6 -3
- package/src/concepts/Return__.ts +31 -17
- package/src/concepts/Role__.ts +17 -8
- package/src/concepts/SelectMembers__.ts +19 -6
- package/src/concepts/Slot__.ts +6 -3
- package/src/concepts/SqlQueryComponent__.ts +28 -14
- package/src/concepts/Start__.ts +11 -3
- package/src/concepts/StringInterpolation__.ts +16 -8
- package/src/concepts/StringLiteral__.ts +13 -4
- package/src/concepts/StructureProperty__.ts +24 -11
- package/src/concepts/Structure__.ts +33 -16
- package/src/concepts/SwitchCase__.ts +28 -17
- package/src/concepts/SwitchStatement__.ts +23 -10
- package/src/concepts/TriggerEvent__.ts +6 -3
- package/src/concepts/TriggerLauncher__.ts +17 -7
- package/src/concepts/TypeAnnotation__.ts +46 -30
- package/src/concepts/TypeParam__.ts +13 -4
- package/src/concepts/UnaryExpression__.ts +28 -12
- package/src/concepts/Unparsed__.ts +10 -3
- package/src/concepts/ValidationRule__.ts +27 -20
- package/src/concepts/Variable__.ts +34 -19
- package/src/concepts/ViewElement__.ts +165 -125
- package/src/concepts/View__.ts +108 -89
- package/src/concepts/WhileStatement__.ts +19 -10
- package/src/concepts/types__.ts +1 -1
- package/src/manager/diagnostic.ts +3 -4
- package/src/server/naslServer.ts +676 -729
- package/src/server/translator.ts +1 -1
- package/src/templator/genCreateBlock.ts +4 -4
- package/src/templator/genCurdEditMultipleKeyBlock.ts +6 -6
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -4
- package/src/templator/genEditTableBlock.ts +2 -2
- package/src/templator/genUpdateBlock.ts +4 -4
- package/src/translator/types.ts +20 -5
- package/src/translator/utils.ts +78 -4
- package/src/utils/time-slicing/constant.ts +37 -0
- package/src/utils/time-slicing/controller.ts +342 -0
- package/src/utils/time-slicing/index.ts +6 -0
- package/src/utils/time-slicing/page-state.ts +12 -0
- package/src/utils/time-slicing/performance.ts +56 -0
- package/src/utils/time-slicing/runner.ts +54 -0
- package/src/utils/time-slicing/tool.ts +45 -0
- package/src/utils/time-slicing/utils.ts +90 -0
- package/src/utils/time-slicing/wrapper.ts +58 -0
- package/src/utils/types.ts +9 -0
- package/test/concepts/anonymous-function/__snapshots__/toEmbeddedTS.spec.ts.snap +8 -0
- package/test/concepts/anonymous-function/__snapshots__/toJS.spec.ts.snap +3 -0
- package/test/concepts/anonymous-function/__snapshots__/toVue.spec.ts.snap +6 -0
- package/test/concepts/anonymous-function/constant.ts +5 -0
- package/test/concepts/anonymous-function/fixtures/simple.json +85 -0
- package/test/concepts/anonymous-function/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/anonymous-function/toJS.spec.ts +14 -0
- package/test/concepts/anonymous-function/toVue.spec.ts +14 -0
- package/test/concepts/assignment/__snapshots__/toEmbeddedTS.spec.ts.snap +21 -0
- package/test/concepts/assignment/__snapshots__/toJS.spec.ts.snap +9 -0
- package/test/concepts/assignment/__snapshots__/toVue.spec.ts.snap +21 -0
- package/test/concepts/assignment/constant.ts +5 -0
- package/test/concepts/assignment/fixtures/both-space.json +4 -0
- package/test/concepts/assignment/fixtures/left-space.json +14 -0
- package/test/concepts/assignment/fixtures/right-space.json +8 -0
- package/test/concepts/assignment/fixtures/simple.json +12 -0
- package/test/concepts/assignment/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/assignment/toJS.spec.ts +14 -0
- package/test/concepts/assignment/toVue.spec.ts +14 -0
- package/test/concepts/batch-assignment/__snapshots__/toEmbeddedTS.spec.ts.snap +28 -0
- package/test/concepts/batch-assignment/__snapshots__/toJS.spec.ts.snap +13 -0
- package/test/concepts/batch-assignment/__snapshots__/toVue.spec.ts.snap +14 -0
- package/test/concepts/batch-assignment/constant.ts +5 -0
- package/test/concepts/batch-assignment/fixtures/muli-var-muli-value.json +144 -0
- package/test/concepts/batch-assignment/fixtures/simple-var-simple-value.json +36 -0
- package/test/concepts/batch-assignment/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/batch-assignment/toJS.spec.ts +14 -0
- package/test/concepts/batch-assignment/toVue.spec.ts +14 -0
- package/test/concepts/binary-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +25 -0
- package/test/concepts/binary-expression/__snapshots__/toJS.spec.ts.snap +17 -0
- package/test/concepts/binary-expression/__snapshots__/toVue.spec.ts.snap +19 -0
- package/test/concepts/binary-expression/constant.ts +5 -0
- package/test/concepts/binary-expression/fixtures/constant-nested.json +36 -0
- package/test/concepts/binary-expression/fixtures/constant-simple.json +12 -0
- package/test/concepts/binary-expression/fixtures/variable-nested.json +69 -0
- package/test/concepts/binary-expression/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/binary-expression/toJS.spec.ts +14 -0
- package/test/concepts/binary-expression/toVue.spec.ts +14 -0
- package/test/concepts/boolean-literal/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/boolean-literal/toJS.spec.ts +2 -2
- package/test/concepts/boolean-literal/toVue.spec.ts +2 -2
- package/test/concepts/call-function/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/call-interface/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/call-logic/getQuickInfoOffset.spec.ts +2 -1
- package/test/concepts/call-logic/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/data-source/__snapshots__/toEmbeddedTS.spec.ts.snap +8 -0
- package/test/concepts/data-source/__snapshots__/toEmbeddedTSFile.spec.ts.snap +12 -0
- package/test/concepts/data-source/constant.ts +5 -0
- package/test/concepts/data-source/fixtures/normal.json +289 -0
- package/test/concepts/data-source/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/data-source/toEmbeddedTSFile.spec.ts +16 -0
- package/test/concepts/entity/__snapshots__/toEmbeddedTS.spec.ts.snap +74 -0
- package/test/concepts/entity/__snapshots__/toEmbeddedTSFile.spec.ts.snap +3 -0
- package/test/concepts/entity/constant.ts +5 -0
- package/test/concepts/entity/fixtures/normal.json +469 -0
- package/test/concepts/entity/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/entity/toEmbeddedTSFile.spec.ts +14 -0
- package/test/concepts/identifier/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/identifier/toJS.spec.ts +2 -2
- package/test/concepts/identifier/toVue.spec.ts +2 -2
- package/test/concepts/match/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/member-expression/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/member-expression/toVue.spec.ts +2 -2
- package/test/concepts/null-literal/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/null-literal/toJS.spec.ts +2 -2
- package/test/concepts/null-literal/toVue.spec.ts +2 -2
- package/test/concepts/numeric-literal/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/numeric-literal/toJS.spec.ts +2 -2
- package/test/concepts/numeric-literal/toVue.spec.ts +2 -2
- package/test/concepts/string-literal/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/string-literal/toJS.spec.ts +2 -2
- package/test/concepts/string-literal/toVue.spec.ts +2 -2
- package/test/concepts/validation-rule/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/validation-rule/validation-rule.spec.ts +2 -1
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +0 -2
- package/test/concepts/view-element/toEmbeddedTS.spec.ts +2 -1
- package/test/time-slicing/runner.spec.ts +28 -0
- package/test/time-slicing/time-slicing-nodejs.spec.ts +27 -0
- package/test/time-slicing/utils.ts +7 -0
- package/test/time-slicing/wrapper.spec.ts +92 -0
- package/ts-worker/lib/tsserver.js +10 -1
- package/ts-worker/package.json +1 -0
- package/ts-worker/src/index.js +13 -12
- package/ts-worker/webpack.config.js +1 -1
- package/out/utils/time-slicing.d.ts +0 -41
- package/out/utils/time-slicing.js +0 -82
- package/out/utils/time-slicing.js.map +0 -1
- package/src/utils/time-slicing.ts +0 -111
package/src/concepts/Entity__.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach, runGeneratorSync as runSync } from '../utils/time-slicing';
|
|
2
|
+
import type { EmbeddedTSFileGenerator } from '../utils';
|
|
1
3
|
import Namespace from './Namespace__';
|
|
2
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
TranslatorState,
|
|
6
|
+
shiftState,
|
|
7
|
+
withSourceMap,
|
|
8
|
+
indent,
|
|
9
|
+
createCompilerState,
|
|
10
|
+
withSourceMapGenerator,
|
|
11
|
+
withGenerator,
|
|
12
|
+
TranslatorGenerator,
|
|
13
|
+
} from '../translator';
|
|
3
14
|
import { entity2LogicNamespace } from '../server/entity2LogicNamespace';
|
|
4
15
|
import CallQueryComponent from './CallQueryComponent__';
|
|
5
16
|
//================================================================================
|
|
@@ -488,9 +499,12 @@ export class Entity extends BaseNode {
|
|
|
488
499
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
489
500
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
490
501
|
params.index = index;
|
|
491
|
-
} else
|
|
492
|
-
|
|
493
|
-
(
|
|
502
|
+
} else {
|
|
503
|
+
const q = (t as any)[parentKey];
|
|
504
|
+
if ((q.__v_raw || q) === n) {
|
|
505
|
+
params.index = 0;
|
|
506
|
+
(this as any)[parentKey] = undefined;
|
|
507
|
+
}
|
|
494
508
|
}
|
|
495
509
|
}
|
|
496
510
|
return params;
|
|
@@ -541,9 +555,12 @@ export class Entity extends BaseNode {
|
|
|
541
555
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
542
556
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
543
557
|
params.index = index;
|
|
544
|
-
} else
|
|
545
|
-
|
|
546
|
-
(
|
|
558
|
+
} else {
|
|
559
|
+
const q = (t as any)[parentKey];
|
|
560
|
+
if ((q.__v_raw || q) === n) {
|
|
561
|
+
params.index = 0;
|
|
562
|
+
(this as any)[parentKey] = undefined;
|
|
563
|
+
}
|
|
547
564
|
}
|
|
548
565
|
}
|
|
549
566
|
return params;
|
|
@@ -820,42 +837,40 @@ export class Entity extends BaseNode {
|
|
|
820
837
|
};
|
|
821
838
|
}
|
|
822
839
|
|
|
823
|
-
@
|
|
824
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
825
|
-
|
|
840
|
+
@withSourceMapGenerator
|
|
841
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
842
|
+
const self = this;
|
|
843
|
+
let code = `export class ${self.name} {\n`;
|
|
826
844
|
code += indent((state?.tabSize || 0) + 1);
|
|
827
|
-
code += `__name: '${
|
|
828
|
-
|
|
845
|
+
code += `__name: '${self.getNamespace()}.${self.name}';\n`;
|
|
846
|
+
yield* wrapForEach(self.properties, function* warpForEachGenerator(property) {
|
|
829
847
|
code += indent((state?.tabSize || 0) + 1);
|
|
830
|
-
code += property.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
848
|
+
code += yield* property.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
831
849
|
code += ';\n';
|
|
832
850
|
});
|
|
833
|
-
if (
|
|
851
|
+
if (self.indexes && self.indexes.length) {
|
|
834
852
|
code += indent((state?.tabSize || 0) + 1);
|
|
835
853
|
code += `__IndexList() {\n`;
|
|
836
854
|
code += ` return [`;
|
|
837
|
-
|
|
855
|
+
yield* wrapForEach(self.indexes, function* warpForEachGenerator(entityIndex) {
|
|
838
856
|
code += indent((state?.tabSize || 0) + 1);
|
|
839
857
|
code += '\n ';
|
|
840
|
-
code += entityIndex.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
858
|
+
code += yield* entityIndex.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
841
859
|
});
|
|
842
860
|
code += `${indent(state?.tabSize || 0)}\n ];\n }\n`;
|
|
843
861
|
}
|
|
844
|
-
|
|
845
|
-
const { ns } = this;
|
|
846
|
-
|
|
862
|
+
const { ns } = self;
|
|
847
863
|
/**
|
|
848
864
|
* 11个函数的总行数
|
|
849
865
|
* 如果修改这里,可能会影响到dataSource的重命名, 在naslserver中,可能要一起修改
|
|
850
866
|
*/
|
|
851
867
|
code += `\nstatic logics = {\n`;
|
|
852
|
-
ns.logics
|
|
868
|
+
yield* wrapForEach(ns.logics, function* warpForEachGenerator(logic) {
|
|
853
869
|
code += indent((state?.tabSize || 0) + 1);
|
|
854
|
-
code += logic.toEmbeddedTS(shiftState(state, code), 'inObject');
|
|
870
|
+
code += yield* logic.toEmbeddedTS(shiftState(state, code), 'inObject');
|
|
855
871
|
});
|
|
856
872
|
code += '}\n';
|
|
857
873
|
code += `${indent(state?.tabSize || 0)}}\n`;
|
|
858
|
-
|
|
859
874
|
return code;
|
|
860
875
|
}
|
|
861
876
|
|
|
@@ -873,7 +888,7 @@ export class Entity extends BaseNode {
|
|
|
873
888
|
this.indexes.forEach((entityIndex) => {
|
|
874
889
|
code += indent(state.tabSize + 1);
|
|
875
890
|
code += '\n ';
|
|
876
|
-
code += entityIndex.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
891
|
+
code += runSync(entityIndex.toEmbeddedTS(shiftState(state, code, { inline: true })));
|
|
877
892
|
});
|
|
878
893
|
code += `${indent(state.tabSize)}\n ];\n }\n`;
|
|
879
894
|
}
|
|
@@ -912,13 +927,13 @@ export class Entity extends BaseNode {
|
|
|
912
927
|
return ns.logics;
|
|
913
928
|
}
|
|
914
929
|
|
|
915
|
-
toEmbeddedTSFile() {
|
|
930
|
+
*toEmbeddedTSFile(): EmbeddedTSFileGenerator {
|
|
916
931
|
let code = `namespace ${this.getNamespace()} {\n`;
|
|
917
932
|
code += ' @nasl.annotation.Entity()\n';
|
|
918
933
|
|
|
919
934
|
const state = createCompilerState(code, { tabSize: 1 });
|
|
920
935
|
try {
|
|
921
|
-
code += this.toEmbeddedTS(state);
|
|
936
|
+
code += yield* this.toEmbeddedTS(state);
|
|
922
937
|
} catch (err) {
|
|
923
938
|
code += '';
|
|
924
939
|
console.log(err);
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
2
|
+
import {
|
|
3
|
+
TranslatorState,
|
|
4
|
+
withSourceMap,
|
|
5
|
+
createCompilerState,
|
|
6
|
+
withSourceMapGenerator,
|
|
7
|
+
withGenerator,
|
|
8
|
+
TranslatorGenerator,
|
|
9
|
+
} from '../translator';
|
|
2
10
|
//================================================================================
|
|
3
11
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
12
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -121,9 +129,10 @@ export class EnumItem extends BaseNode {
|
|
|
121
129
|
@property()
|
|
122
130
|
expression: undefined;
|
|
123
131
|
|
|
124
|
-
@
|
|
125
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
126
|
-
|
|
132
|
+
@withSourceMapGenerator
|
|
133
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
134
|
+
const self = this;
|
|
135
|
+
return `static '${self.value}': ${self.enumeration.name}`;
|
|
127
136
|
}
|
|
128
137
|
|
|
129
138
|
@withSourceMap()
|
package/src/concepts/Enum__.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
2
|
+
import type { EmbeddedTSFileGenerator } from '../utils';
|
|
3
|
+
import {
|
|
4
|
+
TranslatorState,
|
|
5
|
+
shiftState,
|
|
6
|
+
withSourceMap,
|
|
7
|
+
indent,
|
|
8
|
+
createCompilerState,
|
|
9
|
+
withSourceMapGenerator,
|
|
10
|
+
withGenerator,
|
|
11
|
+
TranslatorGenerator,
|
|
12
|
+
} from '../translator';
|
|
2
13
|
import Namespace from './Namespace__';
|
|
3
14
|
import Identifier from './Identifier__';
|
|
4
15
|
//================================================================================
|
|
@@ -264,9 +275,12 @@ export class Enum extends BaseNode {
|
|
|
264
275
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
265
276
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
266
277
|
params.index = index;
|
|
267
|
-
} else
|
|
268
|
-
|
|
269
|
-
(
|
|
278
|
+
} else {
|
|
279
|
+
const q = (t as any)[parentKey];
|
|
280
|
+
if ((q.__v_raw || q) === n) {
|
|
281
|
+
params.index = 0;
|
|
282
|
+
(this as any)[parentKey] = undefined;
|
|
283
|
+
}
|
|
270
284
|
}
|
|
271
285
|
}
|
|
272
286
|
return params;
|
|
@@ -300,14 +314,15 @@ export class Enum extends BaseNode {
|
|
|
300
314
|
return utils.unique(name, this.getEnumItemExistingNames(), undefined, false);
|
|
301
315
|
}
|
|
302
316
|
|
|
303
|
-
@
|
|
304
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
305
|
-
|
|
317
|
+
@withSourceMapGenerator
|
|
318
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
319
|
+
const self = this;
|
|
320
|
+
let code = `export class ${self.name} extends nasl.core.Enums {\n`;
|
|
306
321
|
// 增加一个单独的标签
|
|
307
|
-
code += `${indent((state?.tabSize || 0) + 1)}__name: '${
|
|
308
|
-
|
|
322
|
+
code += `${indent((state?.tabSize || 0) + 1)}__name: '${self.getNamespace()}.${self.name}';\n`;
|
|
323
|
+
yield* wrapForEach(self.enumItems, function* warpForEachGenerator(property) {
|
|
309
324
|
code += indent((state?.tabSize || 0) + 1);
|
|
310
|
-
code += property.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
325
|
+
code += yield* property.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
311
326
|
code += ';\n';
|
|
312
327
|
});
|
|
313
328
|
code += `
|
|
@@ -317,7 +332,6 @@ export class Enum extends BaseNode {
|
|
|
317
332
|
}
|
|
318
333
|
`;
|
|
319
334
|
code += `${indent(state?.tabSize || 0)}}\n`;
|
|
320
|
-
|
|
321
335
|
return code;
|
|
322
336
|
}
|
|
323
337
|
|
|
@@ -356,12 +370,12 @@ export class Enum extends BaseNode {
|
|
|
356
370
|
return `/embedded/${this.app.name}${_path}/enums/${name}.ts`;
|
|
357
371
|
}
|
|
358
372
|
|
|
359
|
-
toEmbeddedTSFile() {
|
|
373
|
+
*toEmbeddedTSFile(): EmbeddedTSFileGenerator {
|
|
360
374
|
let code = `namespace ${this.getNamespace()} {\n`;
|
|
361
375
|
|
|
362
376
|
const state = createCompilerState(code, { tabSize: 1 });
|
|
363
377
|
try {
|
|
364
|
-
code += this.toEmbeddedTS(state);
|
|
378
|
+
code += yield* this.toEmbeddedTS(state);
|
|
365
379
|
} catch (err) {
|
|
366
380
|
code += '';
|
|
367
381
|
console.log(err);
|
package/src/concepts/Event__.ts
CHANGED
|
@@ -313,9 +313,12 @@ export class Event extends BaseNode {
|
|
|
313
313
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
314
314
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
315
315
|
params.index = index;
|
|
316
|
-
} else
|
|
317
|
-
|
|
318
|
-
(
|
|
316
|
+
} else {
|
|
317
|
+
const q = (t as any)[parentKey];
|
|
318
|
+
if ((q.__v_raw || q) === n) {
|
|
319
|
+
params.index = 0;
|
|
320
|
+
(this as any)[parentKey] = undefined;
|
|
321
|
+
}
|
|
319
322
|
}
|
|
320
323
|
}
|
|
321
324
|
return params;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { returnOrigin } from '../utils/time-slicing';
|
|
2
|
+
import {
|
|
3
|
+
TranslatorState,
|
|
4
|
+
shiftState,
|
|
5
|
+
withSourceMap,
|
|
6
|
+
withSourceMapGenerator,
|
|
7
|
+
withGenerator,
|
|
8
|
+
TranslatorGenerator,
|
|
9
|
+
createCompilerState,
|
|
10
|
+
} from '../translator';
|
|
2
11
|
import { ElementToVueOptions } from './ViewElement__';
|
|
3
12
|
import StringLiteral from './StringLiteral__';
|
|
4
13
|
import { BindAttribute, ViewElement, Param } from '..';
|
|
@@ -178,9 +187,12 @@ export class ExternalDestination extends LogicItem {
|
|
|
178
187
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
179
188
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
180
189
|
params.index = index;
|
|
181
|
-
} else
|
|
182
|
-
|
|
183
|
-
(
|
|
190
|
+
} else {
|
|
191
|
+
const q = (t as any)[parentKey];
|
|
192
|
+
if ((q.__v_raw || q) === n) {
|
|
193
|
+
params.index = 0;
|
|
194
|
+
(this as any)[parentKey] = undefined;
|
|
195
|
+
}
|
|
184
196
|
}
|
|
185
197
|
}
|
|
186
198
|
return params;
|
|
@@ -190,17 +202,17 @@ export class ExternalDestination extends LogicItem {
|
|
|
190
202
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
191
203
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
192
204
|
//================================================================================
|
|
193
|
-
@
|
|
194
|
-
toEmbeddedTS(state
|
|
205
|
+
@withSourceMapGenerator
|
|
206
|
+
*toEmbeddedTS(state = createCompilerState(), isHaveKeyWord?: boolean): TranslatorGenerator {
|
|
207
|
+
const self = this;
|
|
195
208
|
let code = '';
|
|
196
|
-
if (
|
|
197
|
-
code += `${
|
|
209
|
+
if (self.link) {
|
|
210
|
+
code += `${yield* self.link.toEmbeddedTS(shiftState(state, code))};`;
|
|
198
211
|
} else {
|
|
199
212
|
code += '__IDENTIFIER__;';
|
|
200
213
|
}
|
|
201
214
|
// code += this.anchor?.expression?.toEmbeddedTS(shiftState(state, code)) + ';' || '';
|
|
202
|
-
code +=
|
|
203
|
-
|
|
215
|
+
code += yield* self.anchor?.toEmbeddedTS(shiftState(state, code), true) ?? returnOrigin('');
|
|
204
216
|
return code;
|
|
205
217
|
}
|
|
206
218
|
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
2
|
+
import {
|
|
3
|
+
TranslatorState,
|
|
4
|
+
shiftState,
|
|
5
|
+
withSourceMap,
|
|
6
|
+
indent,
|
|
7
|
+
createCompilerState,
|
|
8
|
+
withSourceMapGenerator,
|
|
9
|
+
withGenerator,
|
|
10
|
+
TranslatorGenerator,
|
|
11
|
+
} from '../translator';
|
|
2
12
|
import TypeAnnotation from './TypeAnnotation__';
|
|
3
13
|
import Identifier from './Identifier__';
|
|
4
14
|
import MemberExpression from './MemberExpression__';
|
|
@@ -368,9 +378,12 @@ export class ForEachStatement extends LogicItem {
|
|
|
368
378
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
369
379
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
370
380
|
params.index = index;
|
|
371
|
-
} else
|
|
372
|
-
|
|
373
|
-
(
|
|
381
|
+
} else {
|
|
382
|
+
const q = (t as any)[parentKey];
|
|
383
|
+
if ((q.__v_raw || q) === n) {
|
|
384
|
+
params.index = 0;
|
|
385
|
+
(this as any)[parentKey] = undefined;
|
|
386
|
+
}
|
|
374
387
|
}
|
|
375
388
|
}
|
|
376
389
|
return params;
|
|
@@ -446,9 +459,12 @@ export class ForEachStatement extends LogicItem {
|
|
|
446
459
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
447
460
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
448
461
|
params.index = index;
|
|
449
|
-
} else
|
|
450
|
-
|
|
451
|
-
(
|
|
462
|
+
} else {
|
|
463
|
+
const q = (t as any)[parentKey];
|
|
464
|
+
if ((q.__v_raw || q) === n) {
|
|
465
|
+
params.index = 0;
|
|
466
|
+
(this as any)[parentKey] = undefined;
|
|
467
|
+
}
|
|
452
468
|
}
|
|
453
469
|
}
|
|
454
470
|
return params;
|
|
@@ -541,29 +557,30 @@ export class ForEachStatement extends LogicItem {
|
|
|
541
557
|
return code;
|
|
542
558
|
}
|
|
543
559
|
|
|
544
|
-
@
|
|
545
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
560
|
+
@withSourceMapGenerator
|
|
561
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
562
|
+
const self = this;
|
|
546
563
|
let code = '';
|
|
547
|
-
code +=
|
|
548
|
-
?
|
|
564
|
+
code += self.each
|
|
565
|
+
? yield* self.each.toEmbeddedTS(
|
|
549
566
|
shiftState(state, code, {
|
|
550
567
|
tabSize: 0,
|
|
551
568
|
}),
|
|
552
569
|
)
|
|
553
570
|
: '__IDENTIFIER__';
|
|
554
|
-
if (['NewList', 'NewMap'].includes(
|
|
571
|
+
if (['NewList', 'NewMap'].includes(self.each?.concept)) code += '\n';
|
|
555
572
|
code += '.__slice(';
|
|
556
|
-
code +=
|
|
573
|
+
code += self.start ? yield* self.start.toEmbeddedTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
557
574
|
code += ', ';
|
|
558
|
-
code +=
|
|
575
|
+
code += self.end ? yield* self.end.toEmbeddedTS(shiftState(state, code)) : 'null';
|
|
559
576
|
code += ').__forEach((';
|
|
560
|
-
code +=
|
|
577
|
+
code += self.item ? yield* self.item.toEmbeddedTS(shiftState(state, code), true) : '__IDENTIFIER__';
|
|
561
578
|
code += ', ';
|
|
562
|
-
code +=
|
|
579
|
+
code += self.index ? yield* self.index.toEmbeddedTS(shiftState(state, code), true) : '__IDENTIFIER__';
|
|
563
580
|
code += ') => {\n';
|
|
564
|
-
if (Array.isArray(
|
|
565
|
-
|
|
566
|
-
code += `${logicItem.toEmbeddedTS(
|
|
581
|
+
if (Array.isArray(self.body)) {
|
|
582
|
+
yield* wrapForEach(self.body, function* warpForEachGenerator(logicItem) {
|
|
583
|
+
code += `${yield* logicItem.toEmbeddedTS(
|
|
567
584
|
shiftState(state, code, {
|
|
568
585
|
tabSize: (state?.tabSize || 0) + 1,
|
|
569
586
|
}),
|
|
@@ -571,7 +588,6 @@ export class ForEachStatement extends LogicItem {
|
|
|
571
588
|
});
|
|
572
589
|
}
|
|
573
590
|
code += `${indent(state?.tabSize || 0)}})\n`;
|
|
574
|
-
|
|
575
591
|
return code;
|
|
576
592
|
}
|
|
577
593
|
|
|
@@ -98,7 +98,7 @@ export class FrontendLibrary extends BaseNode {
|
|
|
98
98
|
|
|
99
99
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
100
100
|
const excludedSet = new Set(excludedList);
|
|
101
|
-
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
101
|
+
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
102
102
|
}
|
|
103
103
|
getLogicUniqueName(name = 'logic1') {
|
|
104
104
|
return utils.unique(name, this.getLogicExistingNames(), undefined, true);
|
|
@@ -253,7 +253,7 @@ export class FrontendLibrary extends BaseNode {
|
|
|
253
253
|
const excludedSet = new Set(excludedList);
|
|
254
254
|
return ((this.viewComponents as ViewComponent[]) || [])
|
|
255
255
|
.filter((item) => !excludedSet.has(item))
|
|
256
|
-
.map((item) => item
|
|
256
|
+
.map((item) => item?.name);
|
|
257
257
|
}
|
|
258
258
|
getViewComponentUniqueName(name = 'viewComponent1') {
|
|
259
259
|
return utils.unique(name, this.getViewComponentExistingNames(), undefined, false);
|
|
@@ -445,12 +445,16 @@ export class FrontendLibrary extends BaseNode {
|
|
|
445
445
|
// @ts-ignore
|
|
446
446
|
const n = logic.__v_raw || logic;
|
|
447
447
|
if (Array.isArray((t as any)[parentKey])) {
|
|
448
|
-
|
|
448
|
+
// @ts-ignore
|
|
449
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
449
450
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
450
451
|
params.index = index;
|
|
451
|
-
} else
|
|
452
|
-
|
|
453
|
-
(
|
|
452
|
+
} else {
|
|
453
|
+
const q = (t as any)[parentKey];
|
|
454
|
+
if ((q.__v_raw || q) === n) {
|
|
455
|
+
params.index = 0;
|
|
456
|
+
(this as any)[parentKey] = undefined;
|
|
457
|
+
}
|
|
454
458
|
}
|
|
455
459
|
}
|
|
456
460
|
return params;
|
|
@@ -497,12 +501,16 @@ export class FrontendLibrary extends BaseNode {
|
|
|
497
501
|
// @ts-ignore
|
|
498
502
|
const n = viewComponent.__v_raw || viewComponent;
|
|
499
503
|
if (Array.isArray((t as any)[parentKey])) {
|
|
500
|
-
|
|
504
|
+
// @ts-ignore
|
|
505
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
501
506
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
502
507
|
params.index = index;
|
|
503
|
-
} else
|
|
504
|
-
|
|
505
|
-
(
|
|
508
|
+
} else {
|
|
509
|
+
const q = (t as any)[parentKey];
|
|
510
|
+
if ((q.__v_raw || q) === n) {
|
|
511
|
+
params.index = 0;
|
|
512
|
+
(this as any)[parentKey] = undefined;
|
|
513
|
+
}
|
|
506
514
|
}
|
|
507
515
|
}
|
|
508
516
|
return params;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EmbeddedTSFileGenerator } from '../utils';
|
|
2
|
+
import {
|
|
3
|
+
TranslatorState,
|
|
4
|
+
shiftState,
|
|
5
|
+
withSourceMap,
|
|
6
|
+
indent,
|
|
7
|
+
createCompilerState,
|
|
8
|
+
withSourceMapGenerator,
|
|
9
|
+
withGenerator,
|
|
10
|
+
TranslatorGenerator,
|
|
11
|
+
} from '../translator';
|
|
2
12
|
import { AssetsInfo } from './App__';
|
|
3
13
|
import Namespace from './Namespace__';
|
|
4
14
|
import Variable from './Variable__';
|
|
@@ -897,9 +907,12 @@ export class Frontend extends BaseNode {
|
|
|
897
907
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
898
908
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
899
909
|
params.index = index;
|
|
900
|
-
} else
|
|
901
|
-
|
|
902
|
-
(
|
|
910
|
+
} else {
|
|
911
|
+
const q = (t as any)[parentKey];
|
|
912
|
+
if ((q.__v_raw || q) === n) {
|
|
913
|
+
params.index = 0;
|
|
914
|
+
(this as any)[parentKey] = undefined;
|
|
915
|
+
}
|
|
903
916
|
}
|
|
904
917
|
}
|
|
905
918
|
return params;
|
|
@@ -950,9 +963,12 @@ export class Frontend extends BaseNode {
|
|
|
950
963
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
951
964
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
952
965
|
params.index = index;
|
|
953
|
-
} else
|
|
954
|
-
|
|
955
|
-
(
|
|
966
|
+
} else {
|
|
967
|
+
const q = (t as any)[parentKey];
|
|
968
|
+
if ((q.__v_raw || q) === n) {
|
|
969
|
+
params.index = 0;
|
|
970
|
+
(this as any)[parentKey] = undefined;
|
|
971
|
+
}
|
|
956
972
|
}
|
|
957
973
|
}
|
|
958
974
|
return params;
|
|
@@ -1003,9 +1019,12 @@ export class Frontend extends BaseNode {
|
|
|
1003
1019
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1004
1020
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1005
1021
|
params.index = index;
|
|
1006
|
-
} else
|
|
1007
|
-
|
|
1008
|
-
(
|
|
1022
|
+
} else {
|
|
1023
|
+
const q = (t as any)[parentKey];
|
|
1024
|
+
if ((q.__v_raw || q) === n) {
|
|
1025
|
+
params.index = 0;
|
|
1026
|
+
(this as any)[parentKey] = undefined;
|
|
1027
|
+
}
|
|
1009
1028
|
}
|
|
1010
1029
|
}
|
|
1011
1030
|
return params;
|
|
@@ -1056,9 +1075,12 @@ export class Frontend extends BaseNode {
|
|
|
1056
1075
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1057
1076
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1058
1077
|
params.index = index;
|
|
1059
|
-
} else
|
|
1060
|
-
|
|
1061
|
-
(
|
|
1078
|
+
} else {
|
|
1079
|
+
const q = (t as any)[parentKey];
|
|
1080
|
+
if ((q.__v_raw || q) === n) {
|
|
1081
|
+
params.index = 0;
|
|
1082
|
+
(this as any)[parentKey] = undefined;
|
|
1083
|
+
}
|
|
1062
1084
|
}
|
|
1063
1085
|
}
|
|
1064
1086
|
return params;
|
|
@@ -1109,9 +1131,12 @@ export class Frontend extends BaseNode {
|
|
|
1109
1131
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1110
1132
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1111
1133
|
params.index = index;
|
|
1112
|
-
} else
|
|
1113
|
-
|
|
1114
|
-
(
|
|
1134
|
+
} else {
|
|
1135
|
+
const q = (t as any)[parentKey];
|
|
1136
|
+
if ((q.__v_raw || q) === n) {
|
|
1137
|
+
params.index = 0;
|
|
1138
|
+
(this as any)[parentKey] = undefined;
|
|
1139
|
+
}
|
|
1115
1140
|
}
|
|
1116
1141
|
}
|
|
1117
1142
|
return params;
|
|
@@ -1192,21 +1217,22 @@ export class Frontend extends BaseNode {
|
|
|
1192
1217
|
return `/embedded/${this.rootNode?.name || this.parentNode.name}/frontends/${name}.ts`;
|
|
1193
1218
|
}
|
|
1194
1219
|
|
|
1195
|
-
@
|
|
1196
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
1197
|
-
|
|
1220
|
+
@withSourceMapGenerator
|
|
1221
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
1222
|
+
const self = this;
|
|
1223
|
+
let code = `export namespace ${self.name} {\n`;
|
|
1198
1224
|
code += 'const name = ';
|
|
1199
|
-
code += `"${
|
|
1225
|
+
code += `"${self.name}";\n`;
|
|
1200
1226
|
code += '}\n';
|
|
1201
1227
|
return code;
|
|
1202
1228
|
}
|
|
1203
1229
|
|
|
1204
|
-
toEmbeddedTSFile() {
|
|
1230
|
+
*toEmbeddedTSFile(): EmbeddedTSFileGenerator {
|
|
1205
1231
|
let code = `namespace ${this.getNamespace()} {\n`;
|
|
1206
1232
|
|
|
1207
1233
|
const state = createCompilerState(code, { tabSize: 1 });
|
|
1208
1234
|
try {
|
|
1209
|
-
code += this.toEmbeddedTS(state);
|
|
1235
|
+
code += yield* this.toEmbeddedTS(state);
|
|
1210
1236
|
} catch (err) {
|
|
1211
1237
|
code += '';
|
|
1212
1238
|
console.log(err);
|