@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
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
2
|
+
import {
|
|
3
|
+
TranslatorState,
|
|
4
|
+
shiftState,
|
|
5
|
+
withSourceMap,
|
|
6
|
+
createCompilerState,
|
|
7
|
+
withSourceMapGenerator,
|
|
8
|
+
withGenerator,
|
|
9
|
+
TranslatorGenerator,
|
|
10
|
+
} from '../translator';
|
|
2
11
|
import { ElementToVueOptions } from './ViewElement__';
|
|
3
12
|
import MemberExpression from './MemberExpression__';
|
|
4
13
|
//================================================================================
|
|
@@ -281,9 +290,12 @@ export class BindStyle extends BaseNode {
|
|
|
281
290
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
282
291
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
283
292
|
params.index = index;
|
|
284
|
-
} else
|
|
285
|
-
|
|
286
|
-
(
|
|
293
|
+
} else {
|
|
294
|
+
const q = (t as any)[parentKey];
|
|
295
|
+
if ((q.__v_raw || q) === n) {
|
|
296
|
+
params.index = 0;
|
|
297
|
+
(this as any)[parentKey] = undefined;
|
|
298
|
+
}
|
|
287
299
|
}
|
|
288
300
|
}
|
|
289
301
|
return params;
|
|
@@ -487,16 +499,17 @@ export class BindStyle extends BaseNode {
|
|
|
487
499
|
return value && `'${this.name}': ${value}`;
|
|
488
500
|
}
|
|
489
501
|
|
|
490
|
-
@
|
|
491
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
502
|
+
@withSourceMapGenerator
|
|
503
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
504
|
+
const self = this;
|
|
492
505
|
let code = '()=>{';
|
|
493
|
-
if (
|
|
494
|
-
code +=
|
|
506
|
+
if (self.expression) {
|
|
507
|
+
code += yield* self.expression.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
495
508
|
code += ';\n';
|
|
496
509
|
}
|
|
497
|
-
|
|
498
|
-
code += item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
499
|
-
if (index !==
|
|
510
|
+
yield* wrapForEach(self.playground, function* warpForEachGenerator(item, index) {
|
|
511
|
+
code += yield* item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
512
|
+
if (index !== self.playground.length - 1) code += ';\n';
|
|
500
513
|
});
|
|
501
514
|
code += '}';
|
|
502
515
|
return code;
|
|
@@ -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
|
import { ElementToVueOptions } from './ViewElement__';
|
|
3
11
|
//================================================================================
|
|
4
12
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -69,8 +77,8 @@ export class BooleanLiteral extends LogicItem {
|
|
|
69
77
|
return this.value;
|
|
70
78
|
}
|
|
71
79
|
|
|
72
|
-
@
|
|
73
|
-
toEmbeddedTS(state = createCompilerState()) {
|
|
80
|
+
@withSourceMapGenerator
|
|
81
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
74
82
|
return `new nasl.core.Boolean(${this.value})`;
|
|
75
83
|
}
|
|
76
84
|
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach, returnOrigin } from '../utils/time-slicing';
|
|
1
2
|
import Param from './Param__';
|
|
2
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
TranslatorState,
|
|
5
|
+
shiftState,
|
|
6
|
+
withSourceMap,
|
|
7
|
+
createCompilerState,
|
|
8
|
+
withSourceMapGenerator,
|
|
9
|
+
withGenerator,
|
|
10
|
+
TranslatorGenerator,
|
|
11
|
+
} from '../translator';
|
|
3
12
|
import { getNodeByNodeCallee } from '../automate/engine/utils.js';
|
|
4
13
|
import AuthLogicForCallInterface from './AuthLogicForCallInterface__';
|
|
5
14
|
import LogicItem from './LogicItem__';
|
|
@@ -253,9 +262,12 @@ export class CallAuthInterface extends CallInterface {
|
|
|
253
262
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
254
263
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
255
264
|
params.index = index;
|
|
256
|
-
} else
|
|
257
|
-
|
|
258
|
-
(
|
|
265
|
+
} else {
|
|
266
|
+
const q = (t as any)[parentKey];
|
|
267
|
+
if ((q.__v_raw || q) === n) {
|
|
268
|
+
params.index = 0;
|
|
269
|
+
(this as any)[parentKey] = undefined;
|
|
270
|
+
}
|
|
259
271
|
}
|
|
260
272
|
}
|
|
261
273
|
return params;
|
|
@@ -335,32 +347,33 @@ export class CallAuthInterface extends CallInterface {
|
|
|
335
347
|
return authLogicName ? `${tsAuthLogicNamespace}.${authLogicName}` : '__IDENTIFIER__';
|
|
336
348
|
}
|
|
337
349
|
|
|
338
|
-
@
|
|
339
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
340
|
-
|
|
350
|
+
@withSourceMapGenerator
|
|
351
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
352
|
+
const self = this;
|
|
353
|
+
let code = self.tsAuthLogicKey;
|
|
341
354
|
// 目前没有任何其他范型,故这里先支持默认俩范型
|
|
342
355
|
// FIXME
|
|
343
356
|
// fix: http://projectmanage.netease-official.lcap.163yun.com/dashboard/BugDetail?id=2676637477443328
|
|
344
357
|
if (code !== '__IDENTIFIER__') {
|
|
345
|
-
code += `<Parameters<typeof ${
|
|
358
|
+
code += `<Parameters<typeof ${self.tsCalleeKey}>[0], ReturnType<typeof ${self.tsCalleeKey}>>`;
|
|
346
359
|
}
|
|
347
360
|
code += '(';
|
|
348
|
-
const { completeAuthArguments } =
|
|
361
|
+
const { completeAuthArguments } = self;
|
|
349
362
|
if (completeAuthArguments?.length) {
|
|
350
363
|
code += '{';
|
|
351
|
-
completeAuthArguments
|
|
352
|
-
code += arg?.toEmbeddedTS(shiftState(state, code), arg.paramRequired, true);
|
|
364
|
+
yield* wrapForEach(completeAuthArguments, function* warpForEachGenerator(arg, index) {
|
|
365
|
+
code += yield* arg?.toEmbeddedTS(shiftState(state, code), arg.paramRequired, true) ?? returnOrigin('');
|
|
353
366
|
code += ',';
|
|
354
367
|
});
|
|
355
368
|
code += `api: `;
|
|
356
|
-
code +=
|
|
357
|
-
const { completeArguments } =
|
|
369
|
+
code += self.tsCalleeKey;
|
|
370
|
+
const { completeArguments } = self;
|
|
358
371
|
code += '(';
|
|
359
372
|
if (completeArguments?.length) {
|
|
360
373
|
code += '{';
|
|
361
|
-
completeArguments
|
|
362
|
-
code += arg?.toEmbeddedTS(shiftState(state, code), arg.paramRequired, true);
|
|
363
|
-
if (index !==
|
|
374
|
+
yield* wrapForEach(completeArguments, function* warpForEachGenerator(arg, index) {
|
|
375
|
+
code += yield* arg?.toEmbeddedTS(shiftState(state, code), arg.paramRequired, true) ?? returnOrigin('');
|
|
376
|
+
if (index !== self.arguments?.length - 1) code += ', ';
|
|
364
377
|
});
|
|
365
378
|
code += '}';
|
|
366
379
|
}
|
|
@@ -369,35 +382,33 @@ export class CallAuthInterface extends CallInterface {
|
|
|
369
382
|
} else {
|
|
370
383
|
code += '{';
|
|
371
384
|
code += 'api: ';
|
|
372
|
-
code +=
|
|
373
|
-
const { completeArguments } =
|
|
385
|
+
code += self.tsCalleeKey;
|
|
386
|
+
const { completeArguments } = self;
|
|
374
387
|
code += '(';
|
|
375
388
|
if (completeArguments?.length) {
|
|
376
389
|
code += '{';
|
|
377
|
-
completeArguments
|
|
378
|
-
code += arg?.toEmbeddedTS(shiftState(state, code), arg.paramRequired, true);
|
|
379
|
-
if (index !==
|
|
390
|
+
yield* wrapForEach(completeArguments, function* warpForEachGenerator(arg, index) {
|
|
391
|
+
code += yield* arg?.toEmbeddedTS(shiftState(state, code), arg.paramRequired, true) ?? returnOrigin('');
|
|
392
|
+
if (index !== self.arguments?.length - 1) code += ', ';
|
|
380
393
|
});
|
|
381
394
|
code += '}';
|
|
382
395
|
}
|
|
383
396
|
code += ')';
|
|
384
397
|
code += '}';
|
|
385
398
|
}
|
|
386
|
-
|
|
387
399
|
code += ')';
|
|
388
|
-
|
|
389
400
|
if (
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
!['NewMap', 'NewList'].includes(
|
|
400
|
-
|
|
401
|
+
self.parentNode.concept !== 'Argument' &&
|
|
402
|
+
self.parentKey !== 'test' &&
|
|
403
|
+
self.parentKey !== 'patterns' &&
|
|
404
|
+
self.parentNode.concept !== 'Assignment' &&
|
|
405
|
+
self.parentNode.concept !== 'ForEachStatement' &&
|
|
406
|
+
self.parentNode.concept !== 'SelectMembers' &&
|
|
407
|
+
self.parentNode.concept !== 'BinaryExpression' &&
|
|
408
|
+
self.parentNode.concept !== 'MemberExpression' &&
|
|
409
|
+
self.parentNode.concept !== 'StringInterpolation' &&
|
|
410
|
+
!['NewMap', 'NewList'].includes(self.parentNode.concept) &&
|
|
411
|
+
self.parentKey !== 'returnExpression'
|
|
401
412
|
) {
|
|
402
413
|
code += ';';
|
|
403
414
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
1
2
|
import type Connector from './Connector__';
|
|
2
3
|
import { getNodeByNodeCallee } from '../automate/engine/utils';
|
|
3
4
|
import Logic from './Logic__';
|
|
@@ -5,7 +6,15 @@ import Argument from './Argument__';
|
|
|
5
6
|
import Identifier from './Identifier__';
|
|
6
7
|
import TypeAnnotation from './TypeAnnotation__';
|
|
7
8
|
import Connection from './Connection__';
|
|
8
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
TranslatorState,
|
|
11
|
+
shiftState,
|
|
12
|
+
withSourceMap,
|
|
13
|
+
createCompilerState,
|
|
14
|
+
withSourceMapGenerator,
|
|
15
|
+
withGenerator,
|
|
16
|
+
TranslatorGenerator,
|
|
17
|
+
} from '../translator';
|
|
9
18
|
import Namespace from './Namespace__';
|
|
10
19
|
|
|
11
20
|
//================================================================================
|
|
@@ -219,49 +228,48 @@ export class CallConnector extends CallLogic {
|
|
|
219
228
|
});
|
|
220
229
|
}
|
|
221
230
|
|
|
222
|
-
@
|
|
223
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
231
|
+
@withSourceMapGenerator
|
|
232
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
233
|
+
const self = this;
|
|
224
234
|
let code = '';
|
|
225
|
-
if (
|
|
235
|
+
if (self.handleError) {
|
|
226
236
|
code += 'nasl.util.autoHandleError(';
|
|
227
237
|
}
|
|
228
|
-
code +=
|
|
238
|
+
code += self.calleeTSConnectionKey;
|
|
229
239
|
code += '(() => ';
|
|
230
|
-
code +=
|
|
231
|
-
if (Array.isArray(
|
|
240
|
+
code += self.calleeKey;
|
|
241
|
+
if (Array.isArray(self.typeArguments) && self.typeArguments.length) {
|
|
232
242
|
// 如果有内容
|
|
233
|
-
const typeAnnotation =
|
|
243
|
+
const typeAnnotation = self.typeArguments[0];
|
|
234
244
|
code += `<`;
|
|
235
|
-
code += `${typeAnnotation.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }))}>`;
|
|
245
|
+
code += `${yield* typeAnnotation.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }))}>`;
|
|
236
246
|
}
|
|
237
|
-
|
|
238
|
-
const { completeArguments } = this;
|
|
247
|
+
const { completeArguments } = self;
|
|
239
248
|
if (completeArguments.length) {
|
|
240
249
|
code += '(';
|
|
241
|
-
completeArguments
|
|
250
|
+
yield* wrapForEach(completeArguments, function* warpForEachGenerator(arg, index) {
|
|
242
251
|
// 取到是不是必填放入参数中
|
|
243
|
-
code += arg.toEmbeddedTS(shiftState(state, code), arg?.paramRequired);
|
|
244
|
-
if (index !==
|
|
252
|
+
code += yield* arg.toEmbeddedTS(shiftState(state, code), arg?.paramRequired);
|
|
253
|
+
if (index !== self.arguments.length - 1) code += ', ';
|
|
245
254
|
});
|
|
246
255
|
code += ')';
|
|
247
256
|
} else {
|
|
248
257
|
code += '()';
|
|
249
258
|
}
|
|
250
|
-
|
|
251
|
-
if (this.handleError) {
|
|
259
|
+
if (self.handleError) {
|
|
252
260
|
code += ')';
|
|
253
261
|
}
|
|
254
262
|
if (
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
!['NewMap', 'NewList'].includes(
|
|
263
|
+
self.parentNode.concept !== 'Argument' &&
|
|
264
|
+
self.parentKey !== 'test' &&
|
|
265
|
+
self.parentKey !== 'patterns' &&
|
|
266
|
+
self.parentNode.concept !== 'Assignment' &&
|
|
267
|
+
self.parentNode.concept !== 'ForEachStatement' &&
|
|
268
|
+
self.parentNode.concept !== 'SelectMembers' &&
|
|
269
|
+
self.parentNode.concept !== 'BinaryExpression' &&
|
|
270
|
+
self.parentNode.concept !== 'StringInterpolation' &&
|
|
271
|
+
self.parentNode.concept !== 'MemberExpression' &&
|
|
272
|
+
!['NewMap', 'NewList'].includes(self.parentNode.concept)
|
|
265
273
|
) {
|
|
266
274
|
code += ');';
|
|
267
275
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
1
2
|
import {
|
|
2
3
|
TranslatorState,
|
|
3
4
|
shiftState,
|
|
@@ -6,6 +7,9 @@ import {
|
|
|
6
7
|
createCompilerState,
|
|
7
8
|
transfromMetadataType,
|
|
8
9
|
transfromUnionTypeAnnotation,
|
|
10
|
+
withSourceMapGenerator,
|
|
11
|
+
withGenerator,
|
|
12
|
+
TranslatorGenerator,
|
|
9
13
|
} from '../translator';
|
|
10
14
|
import Function from './Function__';
|
|
11
15
|
import { ElementToVueOptions } from './ViewElement__';
|
|
@@ -329,9 +333,12 @@ export class CallFunction extends LogicItem {
|
|
|
329
333
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
330
334
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
331
335
|
params.index = index;
|
|
332
|
-
} else
|
|
333
|
-
|
|
334
|
-
(
|
|
336
|
+
} else {
|
|
337
|
+
const q = (t as any)[parentKey];
|
|
338
|
+
if ((q.__v_raw || q) === n) {
|
|
339
|
+
params.index = 0;
|
|
340
|
+
(this as any)[parentKey] = undefined;
|
|
341
|
+
}
|
|
335
342
|
}
|
|
336
343
|
}
|
|
337
344
|
return params;
|
|
@@ -368,9 +375,12 @@ export class CallFunction extends LogicItem {
|
|
|
368
375
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
369
376
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
370
377
|
params.index = index;
|
|
371
|
-
} else
|
|
372
|
-
|
|
373
|
-
(
|
|
378
|
+
} else {
|
|
379
|
+
const q = (t as any)[parentKey];
|
|
380
|
+
if ((q.__v_raw || q) === n) {
|
|
381
|
+
params.index = 0;
|
|
382
|
+
(this as any)[parentKey] = undefined;
|
|
383
|
+
}
|
|
374
384
|
}
|
|
375
385
|
}
|
|
376
386
|
return params;
|
|
@@ -618,39 +628,40 @@ export class CallFunction extends LogicItem {
|
|
|
618
628
|
}
|
|
619
629
|
}
|
|
620
630
|
|
|
621
|
-
@
|
|
622
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
631
|
+
@withSourceMapGenerator
|
|
632
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
633
|
+
const self = this;
|
|
623
634
|
let code = '';
|
|
624
|
-
const { calleeKey } =
|
|
635
|
+
const { calleeKey } = self;
|
|
625
636
|
if (['nasl.util.Convert', 'nasl.util.FromString'].includes(calleeKey)) {
|
|
626
637
|
// nasl.util.Convert(variable1)<nasl.core.String>();
|
|
627
638
|
// 单独处理
|
|
628
|
-
|
|
629
639
|
code = calleeKey;
|
|
630
640
|
code += '(';
|
|
631
|
-
|
|
632
|
-
code += arg.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
633
|
-
if (index !==
|
|
641
|
+
yield* wrapForEach(self.arguments, function* warpForEachGenerator(arg, index) {
|
|
642
|
+
code += yield* arg.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
643
|
+
if (index !== self.arguments.length - 1) code += ', ';
|
|
634
644
|
});
|
|
635
645
|
code += ')';
|
|
636
646
|
// 如果有内容
|
|
637
|
-
const typeAnnotation =
|
|
647
|
+
const typeAnnotation = self.typeArguments[0];
|
|
638
648
|
code += `<`;
|
|
639
|
-
code += `${typeAnnotation.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }))}>()`;
|
|
649
|
+
code += `${yield* typeAnnotation.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }))}>()`;
|
|
640
650
|
} else {
|
|
641
|
-
code =
|
|
642
|
-
if (Array.isArray(
|
|
651
|
+
code = self.calleeKey;
|
|
652
|
+
if (Array.isArray(self.typeArguments) && self.typeArguments.length) {
|
|
643
653
|
// 如果有内容
|
|
644
|
-
const typeAnnotation =
|
|
654
|
+
const typeAnnotation = self.typeArguments[0];
|
|
645
655
|
code += `<`;
|
|
646
|
-
code += `${typeAnnotation.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }))}>`;
|
|
656
|
+
code += `${yield* typeAnnotation.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }))}>`;
|
|
647
657
|
}
|
|
648
658
|
code += '(';
|
|
649
|
-
Array.isArray(
|
|
650
|
-
|
|
651
|
-
code += arg.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
652
|
-
if (index !==
|
|
659
|
+
if (Array.isArray(self.arguments)) {
|
|
660
|
+
yield* wrapForEach(self.arguments, function* wrapForEach(arg, index) {
|
|
661
|
+
code += yield* arg.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
662
|
+
if (index !== self.arguments.length - 1) code += ', ';
|
|
653
663
|
});
|
|
664
|
+
}
|
|
654
665
|
code += ')';
|
|
655
666
|
}
|
|
656
667
|
return code;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach, returnOrigin } from '../utils/time-slicing';
|
|
2
|
+
import {
|
|
3
|
+
TranslatorState,
|
|
4
|
+
shiftState,
|
|
5
|
+
withSourceMap,
|
|
6
|
+
createCompilerState,
|
|
7
|
+
withSourceMapGenerator,
|
|
8
|
+
withGenerator,
|
|
9
|
+
TranslatorGenerator,
|
|
10
|
+
} from '../translator';
|
|
2
11
|
import Interface from './Interface__';
|
|
3
12
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
13
|
import { getNodeByNodeCallee } from '../automate/engine/utils';
|
|
@@ -216,9 +225,12 @@ export class CallInterface extends LogicItem {
|
|
|
216
225
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
217
226
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
218
227
|
params.index = index;
|
|
219
|
-
} else
|
|
220
|
-
|
|
221
|
-
(
|
|
228
|
+
} else {
|
|
229
|
+
const q = (t as any)[parentKey];
|
|
230
|
+
if ((q.__v_raw || q) === n) {
|
|
231
|
+
params.index = 0;
|
|
232
|
+
(this as any)[parentKey] = undefined;
|
|
233
|
+
}
|
|
222
234
|
}
|
|
223
235
|
}
|
|
224
236
|
return params;
|
|
@@ -434,17 +446,16 @@ export class CallInterface extends LogicItem {
|
|
|
434
446
|
return code;
|
|
435
447
|
}
|
|
436
448
|
|
|
437
|
-
@
|
|
438
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
439
|
-
const
|
|
440
|
-
|
|
449
|
+
@withSourceMapGenerator
|
|
450
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
451
|
+
const self = this;
|
|
452
|
+
const { completeArguments, parentNode, parentKey, tsCalleeKey } = self;
|
|
441
453
|
let code = `${tsCalleeKey}(`;
|
|
442
|
-
|
|
443
454
|
if (completeArguments?.length) {
|
|
444
455
|
code += '{';
|
|
445
|
-
completeArguments
|
|
446
|
-
code += arg?.toEmbeddedTS(shiftState(state, code), arg.paramRequired, true);
|
|
447
|
-
if (index !==
|
|
456
|
+
yield* wrapForEach(completeArguments, function* warpForEachGenerator(arg, index) {
|
|
457
|
+
code += yield* arg?.toEmbeddedTS(shiftState(state, code), arg.paramRequired, true) ?? returnOrigin('');
|
|
458
|
+
if (index !== self.arguments?.length - 1) code += ', ';
|
|
448
459
|
});
|
|
449
460
|
code += '}';
|
|
450
461
|
}
|
|
@@ -624,37 +635,17 @@ export class CallInterface extends LogicItem {
|
|
|
624
635
|
const calleeNamespace = _interface.getNamespace();
|
|
625
636
|
const calleeName = _interface.name;
|
|
626
637
|
// 保留之前的参数
|
|
627
|
-
const params = _interface.params.
|
|
638
|
+
const params = _interface.params.map((param) => {
|
|
628
639
|
const oldArgument = this.arguments.find((node) => node.keyword === param.name);
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}
|
|
639
|
-
return res
|
|
640
|
-
}, []);
|
|
641
|
-
const oldArguments = this.arguments.reduce((res, argumentNode) => {
|
|
642
|
-
const targetParam = _interface.params.find((item) => item.name === argumentNode.keyword);
|
|
643
|
-
if (!targetParam && argumentNode && argumentNode.expression) {
|
|
644
|
-
res.push(
|
|
645
|
-
Argument.from(
|
|
646
|
-
{
|
|
647
|
-
keyword: argumentNode.keyword,
|
|
648
|
-
expression: argumentNode.expression,
|
|
649
|
-
},
|
|
650
|
-
this,
|
|
651
|
-
'arguments',
|
|
652
|
-
),
|
|
653
|
-
);
|
|
654
|
-
}
|
|
655
|
-
return res;
|
|
656
|
-
}, []);
|
|
657
|
-
params.push(...oldArguments);
|
|
640
|
+
return Argument.from(
|
|
641
|
+
{
|
|
642
|
+
keyword: param.name,
|
|
643
|
+
expression: oldArgument?.expression,
|
|
644
|
+
},
|
|
645
|
+
this,
|
|
646
|
+
'arguments',
|
|
647
|
+
);
|
|
648
|
+
});
|
|
658
649
|
|
|
659
650
|
if (this.app) {
|
|
660
651
|
this.app.emit('collect:start', {
|