@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/out/concepts/View__.js
CHANGED
|
@@ -34,6 +34,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
var View_1;
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.PAGE_COMPONENT_INCLUDE_TAG_MAP = exports.View = void 0;
|
|
37
|
+
const time_slicing_1 = require("../utils/time-slicing");
|
|
37
38
|
const translator_1 = require("../translator");
|
|
38
39
|
const translator_2 = __importDefault(require("../bak/translator"));
|
|
39
40
|
const Structure__1 = require("./Structure__");
|
|
@@ -42,6 +43,8 @@ const Assignment__1 = __importDefault(require("./Assignment__"));
|
|
|
42
43
|
const BatchAssignment__1 = __importDefault(require("./BatchAssignment__"));
|
|
43
44
|
const CallInterface__1 = __importDefault(require("./CallInterface__"));
|
|
44
45
|
const CallLogic__1 = __importDefault(require("./CallLogic__"));
|
|
46
|
+
const getBranchCopyUniCode = () => window?.BranchCopyUniCode;
|
|
47
|
+
const removedViewElementCache = {}; // 临时记录删除的页面元素计数的最大值
|
|
45
48
|
const decorators_1 = require("../decorators");
|
|
46
49
|
const utils = __importStar(require("../utils"));
|
|
47
50
|
const BaseNode_1 = __importDefault(require("../common/BaseNode"));
|
|
@@ -50,8 +53,6 @@ const Param__1 = __importDefault(require("./Param__"));
|
|
|
50
53
|
const Variable__1 = __importDefault(require("./Variable__"));
|
|
51
54
|
const Logic__1 = __importDefault(require("./Logic__"));
|
|
52
55
|
const BindEvent__1 = __importDefault(require("./BindEvent__"));
|
|
53
|
-
const getBranchCopyUniCode = () => window?.BranchCopyUniCode;
|
|
54
|
-
const removedViewElementCache = {}; // 临时记录删除的页面元素计数的最大值
|
|
55
56
|
/**
|
|
56
57
|
* 页面
|
|
57
58
|
*/
|
|
@@ -1116,6 +1117,7 @@ class View extends BaseNode_1.default {
|
|
|
1116
1117
|
first: this.children.find((child) => child.isIndex)?.name,
|
|
1117
1118
|
auth: this.auth ? 'loginAuth' : undefined,
|
|
1118
1119
|
viewBindEvents: this.getViewBindEvents(),
|
|
1120
|
+
viewBindSyncAttrs: this.getViewBindSyncAttrs(),
|
|
1119
1121
|
viewExpressions: this.getViewExpressions(),
|
|
1120
1122
|
elements: componentList,
|
|
1121
1123
|
elementsAll: componentListExtra,
|
|
@@ -1275,16 +1277,15 @@ class View extends BaseNode_1.default {
|
|
|
1275
1277
|
elementsAttrsAll(elements, componentListExtra) {
|
|
1276
1278
|
if (elements) {
|
|
1277
1279
|
elements.forEach((item) => {
|
|
1278
|
-
|
|
1279
|
-
componentListExtra.push(item);
|
|
1280
|
-
}
|
|
1280
|
+
componentListExtra.push(item);
|
|
1281
1281
|
if (item.children.length > 0) {
|
|
1282
1282
|
this.elementsAttrsAll(item.children, componentListExtra);
|
|
1283
1283
|
}
|
|
1284
1284
|
});
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
|
-
toEmbeddedTS(state = (0, translator_1.createCompilerState)()) {
|
|
1287
|
+
*toEmbeddedTS(state = (0, translator_1.createCompilerState)()) {
|
|
1288
|
+
const self = this;
|
|
1288
1289
|
function chineseTsName(name) {
|
|
1289
1290
|
let tsName = name;
|
|
1290
1291
|
// 匹配所有特殊字符都转为_
|
|
@@ -1293,15 +1294,15 @@ class View extends BaseNode_1.default {
|
|
|
1293
1294
|
}
|
|
1294
1295
|
// 获取虚拟logic的参数和内容
|
|
1295
1296
|
// 用作展示和tots查找引用
|
|
1296
|
-
|
|
1297
|
-
let code = `export namespace ${
|
|
1297
|
+
self.getElementLogicRoot();
|
|
1298
|
+
let code = `export namespace ${self.tsName} {\n`;
|
|
1298
1299
|
// 角色
|
|
1299
|
-
if (Array.isArray(
|
|
1300
|
+
if (Array.isArray(self.bindRoles) && self.bindRoles.length) {
|
|
1300
1301
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1301
1302
|
code += 'export let __bindRoles = [\n';
|
|
1302
|
-
|
|
1303
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.bindRoles, function* warpForEachGenerator(role) {
|
|
1303
1304
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1304
|
-
code += `${
|
|
1305
|
+
code += `${self.app.getNamespace()}.roles.${chineseTsName(role)}.${chineseTsName(role)},`;
|
|
1305
1306
|
code += '\n';
|
|
1306
1307
|
});
|
|
1307
1308
|
code += '\n';
|
|
@@ -1310,23 +1311,23 @@ class View extends BaseNode_1.default {
|
|
|
1310
1311
|
}
|
|
1311
1312
|
// 需要类型推导的局部变量/返回值需要调整申明顺序
|
|
1312
1313
|
const advanceMap = new Map();
|
|
1313
|
-
|
|
1314
|
+
yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
|
|
1314
1315
|
if (el && (el instanceof BatchAssignment__1.default || (el instanceof Assignment__1.default && el.left?.name))) {
|
|
1315
1316
|
// 子页面内部逻辑过滤
|
|
1316
|
-
if (el.view !==
|
|
1317
|
+
if (el.view !== self)
|
|
1317
1318
|
return;
|
|
1318
1319
|
if (el instanceof Assignment__1.default) {
|
|
1319
|
-
const advanceVar =
|
|
1320
|
+
const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && el.left?.name === variable.name);
|
|
1320
1321
|
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1321
1322
|
advanceMap.set(advanceVar, el);
|
|
1322
1323
|
}
|
|
1323
1324
|
}
|
|
1324
1325
|
else if (el instanceof BatchAssignment__1.default) {
|
|
1325
|
-
el.assignmentLines
|
|
1326
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
|
|
1326
1327
|
const leftCode = leftIndex.length === 1
|
|
1327
|
-
? el.left?.expression?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1328
|
-
: el.left?.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1329
|
-
const advanceVar =
|
|
1328
|
+
? yield* el.left?.expression?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ?? (0, time_slicing_1.returnOrigin)('')
|
|
1329
|
+
: yield* el.left?.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ?? (0, time_slicing_1.returnOrigin)('');
|
|
1330
|
+
const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && leftCode === variable.name);
|
|
1330
1331
|
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1331
1332
|
advanceMap.set(advanceVar, el);
|
|
1332
1333
|
}
|
|
@@ -1334,38 +1335,38 @@ class View extends BaseNode_1.default {
|
|
|
1334
1335
|
}
|
|
1335
1336
|
}
|
|
1336
1337
|
});
|
|
1337
|
-
if (Array.isArray(
|
|
1338
|
-
|
|
1338
|
+
if (Array.isArray(self.params)) {
|
|
1339
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param) {
|
|
1339
1340
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1340
|
-
code += param.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1341
|
+
code += yield* param.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1341
1342
|
code += ';\n';
|
|
1342
1343
|
});
|
|
1343
1344
|
}
|
|
1344
|
-
if (Array.isArray(
|
|
1345
|
-
|
|
1345
|
+
if (Array.isArray(self.variables)) {
|
|
1346
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.variables, function* warpForEachGenerator(variable) {
|
|
1346
1347
|
if (!advanceMap.get(variable)) {
|
|
1347
1348
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1348
|
-
code += variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1349
|
+
code += yield* variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1349
1350
|
code += ';\n';
|
|
1350
1351
|
}
|
|
1351
1352
|
});
|
|
1352
1353
|
}
|
|
1353
|
-
advanceMap.
|
|
1354
|
+
yield* (0, time_slicing_1.wrapIteratorToGenerator)(advanceMap.entries(), function* warpForEachGenerator([variable, assignment]) {
|
|
1354
1355
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}// @ts-ignore\n`;
|
|
1355
1356
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1356
|
-
code += variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1357
|
+
code += yield* variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1357
1358
|
code += ' = ';
|
|
1358
1359
|
if (assignment instanceof BatchAssignment__1.default) {
|
|
1359
|
-
assignment.assignmentLines
|
|
1360
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(assignment.assignmentLines, function* warpForEachGenerator({ leftIndex, rightIndex }) {
|
|
1360
1361
|
const leftCode = leftIndex.length === 1
|
|
1361
|
-
? assignment.left.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1362
|
-
: assignment.left.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1362
|
+
? yield* assignment.left.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1363
|
+
: yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ?? (0, time_slicing_1.returnOrigin)('');
|
|
1363
1364
|
if (leftCode === variable.name) {
|
|
1364
1365
|
const rightNode = rightIndex.length === 1
|
|
1365
1366
|
? assignment.rights[rightIndex[0]]?.expression
|
|
1366
1367
|
: assignment.rights[rightIndex[0]]?.members[rightIndex[1]];
|
|
1367
|
-
const rightCode = rightNode?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1368
|
-
code +=
|
|
1368
|
+
const rightCode = yield* rightNode?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ?? (0, time_slicing_1.returnOrigin)('');
|
|
1369
|
+
code += yield* self.getRightCode(rightCode, assignment, rightNode);
|
|
1369
1370
|
}
|
|
1370
1371
|
});
|
|
1371
1372
|
}
|
|
@@ -1380,53 +1381,53 @@ class View extends BaseNode_1.default {
|
|
|
1380
1381
|
}
|
|
1381
1382
|
rightCode +=
|
|
1382
1383
|
assignment.right && assignment.right.toEmbeddedTS
|
|
1383
|
-
? assignment.right.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1384
|
+
? yield* assignment.right.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1384
1385
|
: '__RIGHT__';
|
|
1385
|
-
code +=
|
|
1386
|
+
code += yield* self.getRightCode(rightCode, assignment, assignment.right);
|
|
1386
1387
|
}
|
|
1387
1388
|
code += ';\n';
|
|
1388
1389
|
});
|
|
1389
1390
|
// elements类型声明定义
|
|
1390
1391
|
code += `interface __elements {\n`;
|
|
1391
1392
|
// 生成所有的name和类型定义
|
|
1392
|
-
|
|
1393
|
-
code += element.toEmbeddedTSDefinition((0, translator_1.shiftState)(state, code, {
|
|
1393
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(element) {
|
|
1394
|
+
code += yield* element.toEmbeddedTSDefinition((0, translator_1.shiftState)(state, code, {
|
|
1394
1395
|
tabSize: (state?.tabSize || 0) + 1,
|
|
1395
1396
|
}));
|
|
1396
1397
|
});
|
|
1397
1398
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}}\n`;
|
|
1398
1399
|
code += `let __elements: __elements;\n`;
|
|
1399
|
-
if (Array.isArray(
|
|
1400
|
+
if (Array.isArray(self.elements)) {
|
|
1400
1401
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}interface `;
|
|
1401
1402
|
code += `__elements_completionProperty {\n`;
|
|
1402
1403
|
const componentList = [];
|
|
1403
|
-
|
|
1404
|
+
self.elementsAttrs(self.elements, componentList);
|
|
1404
1405
|
const variableList = [];
|
|
1405
|
-
|
|
1406
|
-
code += item.toEmbeddedTSVariableDefinition((0, translator_1.shiftState)(state, code, { inline: true }), variableList);
|
|
1406
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(item) {
|
|
1407
|
+
code += yield* item.toEmbeddedTSVariableDefinition((0, translator_1.shiftState)(state, code, { inline: true }), variableList);
|
|
1407
1408
|
});
|
|
1408
1409
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1) + `}\n`;
|
|
1409
1410
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1410
1411
|
code += `let __elements_completionProperty: __elements_completionProperty;\n`;
|
|
1411
1412
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1412
1413
|
code += `let __elements_variable_function = {\n`;
|
|
1413
|
-
|
|
1414
|
-
code += item.toEmbeddedTSVariableFunctionDefinition((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1414
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(item) {
|
|
1415
|
+
code += yield* item.toEmbeddedTSVariableFunctionDefinition((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1415
1416
|
});
|
|
1416
1417
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1) + `}\n`;
|
|
1417
1418
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1418
1419
|
code += `let __elements_stashFunctionVariable = {\n`;
|
|
1419
|
-
|
|
1420
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(variableList, function* warpForEachGenerator(item) {
|
|
1420
1421
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 2);
|
|
1421
1422
|
code += `${item}`;
|
|
1422
1423
|
});
|
|
1423
1424
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1) + `}\n`;
|
|
1424
1425
|
}
|
|
1425
1426
|
// 逻辑
|
|
1426
|
-
if (Array.isArray(
|
|
1427
|
+
if (Array.isArray(self.logics) && self.logics.length) {
|
|
1427
1428
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1428
|
-
|
|
1429
|
-
code += logic.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1429
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.logics, function* warpForEachGenerator(logic) {
|
|
1430
|
+
code += yield* logic.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1430
1431
|
tabSize: (state?.tabSize || 0) + 2,
|
|
1431
1432
|
}), 'noExport');
|
|
1432
1433
|
code += '\n';
|
|
@@ -1434,9 +1435,9 @@ class View extends BaseNode_1.default {
|
|
|
1434
1435
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1435
1436
|
}
|
|
1436
1437
|
// 事件
|
|
1437
|
-
if (Array.isArray(
|
|
1438
|
-
|
|
1439
|
-
code += event.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1438
|
+
if (Array.isArray(self.bindEvents)) {
|
|
1439
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.bindEvents, function* warpForEachGenerator(event) {
|
|
1440
|
+
code += yield* event.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1440
1441
|
tabSize: state?.tabSize || 0,
|
|
1441
1442
|
}), true);
|
|
1442
1443
|
code += '\n';
|
|
@@ -1448,21 +1449,21 @@ class View extends BaseNode_1.default {
|
|
|
1448
1449
|
code += `){\n`;
|
|
1449
1450
|
code += (0, translator_1.indent)(state?.tabSize || 0);
|
|
1450
1451
|
// elements 元素
|
|
1451
|
-
if (Array.isArray(
|
|
1452
|
+
if (Array.isArray(self.elements)) {
|
|
1452
1453
|
// 生成嵌套式的内容
|
|
1453
|
-
|
|
1454
|
-
code += element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1454
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(element) {
|
|
1455
|
+
code += yield* element.toEmbeddedTS((0, translator_1.shiftState)(state, code, {
|
|
1455
1456
|
tabSize: (state?.tabSize || 0) + 3,
|
|
1456
1457
|
}));
|
|
1457
1458
|
code += '\n';
|
|
1458
1459
|
});
|
|
1459
1460
|
}
|
|
1460
1461
|
code += `\n${(0, translator_1.indent)((state?.tabSize || 0) + 1)}}\n`;
|
|
1461
|
-
if (Array.isArray(
|
|
1462
|
+
if (Array.isArray(self.params)) {
|
|
1462
1463
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}export function $destination(options: {`;
|
|
1463
|
-
|
|
1464
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param, index) {
|
|
1464
1465
|
code += `${param.name}?: `;
|
|
1465
|
-
code += param.typeAnnotation.toEmbeddedTS((0, translator_1.shiftState)(state, code));
|
|
1466
|
+
code += yield* param.typeAnnotation.toEmbeddedTS((0, translator_1.shiftState)(state, code));
|
|
1466
1467
|
code += ', ';
|
|
1467
1468
|
});
|
|
1468
1469
|
// 锚点
|
|
@@ -1561,13 +1562,13 @@ ${(0, translator_1.indent)(state.tabSize)}export function ${this.tsName}_view`;
|
|
|
1561
1562
|
code += `${(0, translator_1.indent)(state.tabSize)}}\n`;
|
|
1562
1563
|
return code;
|
|
1563
1564
|
}
|
|
1564
|
-
toEmbeddedTSFile() {
|
|
1565
|
+
*toEmbeddedTSFile() {
|
|
1565
1566
|
let code = `namespace ${this.getTsNamespace()} {\n`;
|
|
1566
1567
|
const state = (0, translator_1.createCompilerState)(code, {
|
|
1567
1568
|
tabSize: 1,
|
|
1568
1569
|
});
|
|
1569
1570
|
try {
|
|
1570
|
-
code += this.toEmbeddedTS(state);
|
|
1571
|
+
code += yield* this.toEmbeddedTS(state);
|
|
1571
1572
|
}
|
|
1572
1573
|
catch (err) {
|
|
1573
1574
|
code += '';
|
|
@@ -1680,6 +1681,16 @@ ${(0, translator_1.indent)(state.tabSize)}export function ${this.tsName}_view`;
|
|
|
1680
1681
|
});
|
|
1681
1682
|
return bindEvents;
|
|
1682
1683
|
}
|
|
1684
|
+
// 获取页面内所有开启了双向绑定的属性
|
|
1685
|
+
getViewBindSyncAttrs() {
|
|
1686
|
+
const bindSyncAttrs = [];
|
|
1687
|
+
this.elements.forEach((item) => {
|
|
1688
|
+
utils.traverse((current) => {
|
|
1689
|
+
bindSyncAttrs.push(...current.node.getSyncBindAttrs());
|
|
1690
|
+
}, { node: item });
|
|
1691
|
+
});
|
|
1692
|
+
return bindSyncAttrs;
|
|
1693
|
+
}
|
|
1683
1694
|
// 获取页面上需要替换的表达式
|
|
1684
1695
|
getViewExpressions() {
|
|
1685
1696
|
const bindExpressions = [];
|
|
@@ -1806,7 +1817,7 @@ ${(0, translator_1.indent)(state.tabSize)}export function ${this.tsName}_view`;
|
|
|
1806
1817
|
removedViewElementCache[prefix] = lastDigit;
|
|
1807
1818
|
}
|
|
1808
1819
|
}
|
|
1809
|
-
getRightCode(code, assignment, rightNode) {
|
|
1820
|
+
*getRightCode(code, assignment, rightNode) {
|
|
1810
1821
|
code = code.replaceAll('\n', ' ');
|
|
1811
1822
|
const logic = assignment.logic;
|
|
1812
1823
|
const logicRtn = logic?.returns[0];
|
|
@@ -1838,7 +1849,7 @@ ${(0, translator_1.indent)(state.tabSize)}export function ${this.tsName}_view`;
|
|
|
1838
1849
|
}
|
|
1839
1850
|
// 处理 current.item、current1.item 等数据
|
|
1840
1851
|
if (/current(\d)*\.item/.test(code)) {
|
|
1841
|
-
code = this.handleCurrentItemCode(code, logic);
|
|
1852
|
+
code = yield* this.handleCurrentItemCode(code, logic);
|
|
1842
1853
|
return code;
|
|
1843
1854
|
}
|
|
1844
1855
|
// 直接赋值 logic 内局部变量、输入参数直接提示系统无法推断类型
|
|
@@ -1885,16 +1896,16 @@ ${(0, translator_1.indent)(state.tabSize)}export function ${this.tsName}_view`;
|
|
|
1885
1896
|
}
|
|
1886
1897
|
return viewElements;
|
|
1887
1898
|
}
|
|
1888
|
-
handleCurrentItemCode(code, logic) {
|
|
1899
|
+
*handleCurrentItemCode(code, logic) {
|
|
1889
1900
|
const viewElementsWithDataSource = this.getAncestorViewElementsWithDataSource(logic);
|
|
1890
|
-
|
|
1901
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(viewElementsWithDataSource, function* wrapForEach(viewElement, index) {
|
|
1891
1902
|
const currentIndex = viewElementsWithDataSource.length - 1 - index;
|
|
1892
1903
|
const currentItemCode = `current${currentIndex === 0 ? '' : currentIndex}.item`;
|
|
1893
1904
|
if (code.includes(currentItemCode)) {
|
|
1894
1905
|
const dataSource = viewElement.bindAttrs.find((bAttr) => bAttr.name === 'data-source');
|
|
1895
1906
|
if (dataSource) {
|
|
1896
1907
|
const view = viewElement.getAncestor('View');
|
|
1897
|
-
const dataSourceTS = dataSource.expression.toEmbeddedTS();
|
|
1908
|
+
const dataSourceTS = yield* dataSource.expression.toEmbeddedTS();
|
|
1898
1909
|
const logic = view.logics.find((logic) => logic.name === dataSourceTS);
|
|
1899
1910
|
if (logic) {
|
|
1900
1911
|
code = code.replaceAll(currentItemCode, `nasl.ui.getCurrentItemType(${dataSourceTS}(${logic.params.map(() => 'null').join(',')}))`);
|
|
@@ -1976,7 +1987,7 @@ __decorate([
|
|
|
1976
1987
|
(0, decorators_1.property)('View')
|
|
1977
1988
|
], View.prototype, "children", void 0);
|
|
1978
1989
|
__decorate([
|
|
1979
|
-
|
|
1990
|
+
translator_1.withSourceMapGenerator
|
|
1980
1991
|
], View.prototype, "toEmbeddedTS", null);
|
|
1981
1992
|
__decorate([
|
|
1982
1993
|
(0, translator_1.withSourceMap)()
|