@lcap/nasl 3.3.0-alpha.1 → 3.3.0-alpha.3
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/automate/upgrader/2.20.js.map +1 -1
- package/out/bak/translator.js +52 -1
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/shared/utils.js +0 -2
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/common/Command.d.ts +1 -0
- package/out/common/Command.js +9 -1
- package/out/common/Command.js.map +1 -1
- package/out/concepts/Abort__.js +2 -1
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.js +1 -1
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js +2 -2
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/Argument__.js +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js +1 -1
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js +2 -2
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +1 -1
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.js +1 -1
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +2 -2
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +2 -2
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +2 -0
- package/out/concepts/BindAttribute__.js +79 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +2 -1
- package/out/concepts/BindEvent__.js +44 -37
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +1 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.js +1 -1
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.js +1 -1
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.js +2 -2
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +2 -2
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +69 -12
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +1 -1
- package/out/concepts/CallQueryComponent__.js +1 -1
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +1 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Connection__.js +9 -10
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.js +1 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.js +2 -2
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.js +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +2 -2
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +2 -2
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js +2 -2
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +2 -2
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +27 -37
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Frontend__.js +1 -1
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +2 -2
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +1 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Interface__.js +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.js +1 -1
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicItem__.js +3 -2
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +2 -1
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +2 -2
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +1 -0
- package/out/concepts/MemberExpression__.js +117 -2
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +1 -1
- package/out/concepts/Module__.js +34 -35
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/NewComposite__.js +2 -2
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js +2 -2
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js +2 -2
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.js +1 -1
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +2 -2
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.js +1 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +1 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js +1 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js +1 -1
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/Return__.js +2 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +1 -1
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +2 -2
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +2 -2
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +2 -2
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +2 -2
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +1 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +2 -2
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.js +1 -1
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +4 -3
- package/out/concepts/TypeAnnotation__.js +116 -75
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +2 -2
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +14 -14
- package/out/concepts/ValidationRule__.js +28 -24
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +2 -2
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +88 -87
- package/out/concepts/ViewElement__.js +268 -204
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +6 -0
- package/out/concepts/View__.js +254 -11
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +2 -2
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.browser.js +1 -0
- package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.event.js +2 -0
- package/out/concepts/basics/stdlib/nasl.event.js.map +1 -1
- package/out/generator/genBundleFiles.js +90 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +1 -1
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/permission.js +3 -3
- package/out/generator/permission.js.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/natural/genNaturalTS.js +7 -3
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/knowledgeMap.js +12 -12
- package/out/natural/knowledgeMap.js.map +1 -1
- package/out/natural/transformTSCode.d.ts +1 -1
- package/out/natural/transformTSCode.js +115 -141
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/extendBaseNode.js +69 -44
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.js +72 -63
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.js +20 -23
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +1 -0
- package/out/server/getMemberIdentifier.js +149 -1
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +3 -3
- package/out/server/naslServer.js +182 -132
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +43 -33
- package/out/server/translator.js.map +1 -1
- package/out/service/defaultErrorMessage.json +6 -6
- package/out/service/storage/init.js +16 -0
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +5 -3
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +12 -8
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +8 -7
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.d.ts +1 -1
- package/out/templator/genEditTableBlock.js +12 -6
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +2 -2
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.d.ts +2 -2
- package/out/templator/genGridViewBlock.js +20 -7
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.d.ts +2 -2
- package/out/templator/genListViewBlock.js +13 -5
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.d.ts +2 -2
- package/out/templator/genSelectBlock.js +8 -6
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +1 -1
- package/out/templator/genTableBlock.js +10 -5
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +5 -3
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/package.json +3 -1
- package/sandbox/stdlib/nasl.auth.ts +40 -44
- package/sandbox/stdlib/nasl.core.ts +8 -1
- package/sandbox/stdlib/nasl.http.ts +22 -22
- package/sandbox-natural/stdlib/nasl.util.ts +74 -15
- package/src/automate/upgrader/2.20.js +17 -13
- package/src/bak/translator.js +50 -1
- package/src/breakpoint/shared/utils.ts +0 -2
- package/src/common/Command.ts +8 -0
- package/src/concepts/Abort__.ts +2 -2
- package/src/concepts/Anchor__.ts +2 -2
- package/src/concepts/AnonymousFunction__.ts +3 -3
- package/src/concepts/Argument__.ts +2 -2
- package/src/concepts/Assignee__.ts +1 -1
- package/src/concepts/AssignmentLine__.ts +2 -2
- package/src/concepts/Assignment__.ts +3 -3
- package/src/concepts/BackendVariable__.ts +2 -2
- package/src/concepts/Backend__.ts +1 -1
- package/src/concepts/BatchAssignment__.ts +3 -3
- package/src/concepts/BinaryExpression__.ts +3 -3
- package/src/concepts/BindAttribute__.ts +69 -4
- package/src/concepts/BindDirective__.ts +2 -2
- package/src/concepts/BindEvent__.ts +44 -64
- package/src/concepts/BindStyle__.ts +2 -2
- package/src/concepts/BooleanLiteral__.ts +2 -2
- package/src/concepts/CallAuthInterface__.ts +2 -2
- package/src/concepts/CallConnector__.ts +2 -2
- package/src/concepts/CallFunction__.ts +3 -3
- package/src/concepts/CallInterface__.ts +3 -3
- package/src/concepts/CallLogic__.ts +69 -13
- package/src/concepts/CallQueryComponent__.ts +2 -2
- package/src/concepts/Comment__.ts +2 -2
- package/src/concepts/ConfigProperty__.ts +2 -2
- package/src/concepts/Connection__.ts +15 -21
- package/src/concepts/Constant__.ts +2 -2
- package/src/concepts/DataSource__.ts +1 -1
- package/src/concepts/Destination__.ts +3 -3
- package/src/concepts/End__.ts +2 -2
- package/src/concepts/EntityIndex__.ts +2 -2
- package/src/concepts/EntityProperty__.ts +3 -3
- package/src/concepts/Entity__.ts +2 -2
- package/src/concepts/EnumItem__.ts +3 -3
- package/src/concepts/Enum__.ts +2 -2
- package/src/concepts/ForEachStatement__.ts +35 -46
- package/src/concepts/Frontend__.ts +1 -1
- package/src/concepts/Function__.ts +3 -3
- package/src/concepts/Identifier__.ts +2 -2
- package/src/concepts/IfStatement__.ts +3 -3
- package/src/concepts/Interface__.ts +1 -1
- package/src/concepts/JSBlock__.ts +2 -2
- package/src/concepts/JavaLogic__.ts +2 -2
- package/src/concepts/LogicItem__.ts +3 -3
- package/src/concepts/Logic__.ts +2 -1
- package/src/concepts/MatchCase__.ts +2 -2
- package/src/concepts/Match__.ts +3 -3
- package/src/concepts/MemberExpression__.ts +112 -4
- package/src/concepts/Module__.ts +41 -58
- package/src/concepts/NewComposite__.ts +3 -3
- package/src/concepts/NewList__.ts +3 -3
- package/src/concepts/NewMap__.ts +3 -3
- package/src/concepts/New__.ts +2 -2
- package/src/concepts/NullLiteral__.ts +2 -2
- package/src/concepts/NumericLiteral__.ts +2 -2
- package/src/concepts/OqlQueryComponent__.ts +3 -3
- package/src/concepts/Param__.ts +2 -2
- package/src/concepts/ProcessElement__.ts +2 -2
- package/src/concepts/ProcessOutcome__.ts +2 -2
- package/src/concepts/ProcessOutcomes__.ts +2 -2
- package/src/concepts/Process__.ts +1 -1
- package/src/concepts/QueryAggregateExpression__.ts +2 -2
- package/src/concepts/QueryFieldExpression__.ts +2 -2
- package/src/concepts/QueryFromExpression__.ts +2 -2
- package/src/concepts/QueryJoinExpression__.ts +2 -2
- package/src/concepts/QueryLimitExpression__.ts +2 -2
- package/src/concepts/QueryOrderByExpression__.ts +2 -2
- package/src/concepts/Return__.ts +3 -3
- package/src/concepts/Role__.ts +1 -1
- package/src/concepts/SelectMembers__.ts +2 -2
- package/src/concepts/SqlQueryComponent__.ts +3 -3
- package/src/concepts/Start__.ts +2 -2
- package/src/concepts/StringInterpolation__.ts +3 -3
- package/src/concepts/StringLiteral__.ts +2 -2
- package/src/concepts/StructureProperty__.ts +3 -3
- package/src/concepts/Structure__.ts +2 -2
- package/src/concepts/SwitchCase__.ts +2 -2
- package/src/concepts/SwitchStatement__.ts +3 -3
- package/src/concepts/TriggerLauncher__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +145 -125
- package/src/concepts/TypeParam__.ts +2 -2
- package/src/concepts/UnaryExpression__.ts +3 -3
- package/src/concepts/ValidationRule__.ts +554 -524
- package/src/concepts/Variable__.ts +3 -3
- package/src/concepts/ViewElement__.ts +2445 -2498
- package/src/concepts/View__.ts +258 -10
- package/src/concepts/WhileStatement__.ts +3 -3
- package/src/concepts/basics/stdlib/nasl.browser.ts +1 -0
- package/src/concepts/basics/stdlib/nasl.event.ts +2 -0
- package/src/generator/genBundleFiles.ts +91 -1
- package/src/generator/genReleaseBody.ts +1 -1
- package/src/generator/permission.ts +3 -3
- package/src/index.ts +1 -0
- package/src/natural/genNaturalTS.ts +8 -4
- package/src/natural/knowledgeMap.ts +12 -12
- package/src/natural/transformTSCode.ts +139 -151
- package/src/server/extendBaseNode.ts +71 -45
- package/src/server/formatTsUtils.ts +64 -64
- package/src/server/getLogics.ts +23 -30
- package/src/server/getMemberIdentifier.ts +143 -0
- package/src/server/naslServer.ts +174 -148
- package/src/server/translator.ts +40 -39
- package/src/service/defaultErrorMessage.json +6 -6
- package/src/service/storage/init.ts +17 -0
- package/src/templator/genCreateBlock.ts +5 -3
- package/src/templator/genCurdEditMultipleKeyBlock.ts +12 -8
- package/src/templator/genCurdMultipleKeyBlock.ts +8 -7
- package/src/templator/genEditTableBlock.ts +12 -7
- package/src/templator/genEnumSelectBlock.ts +2 -2
- package/src/templator/genGetBlock.ts +6 -6
- package/src/templator/genGridViewBlock.ts +22 -9
- package/src/templator/genListViewBlock.ts +14 -5
- package/src/templator/genSelectBlock.ts +8 -6
- package/src/templator/genTableBlock.ts +10 -9
- package/src/templator/genUpdateBlock.ts +5 -3
- package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +11 -0
- package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +10 -0
- package/test/concepts/validation-rule/fixtures/argument-without-keyword.json +34 -0
- package/test/concepts/validation-rule/fixtures/empty-rule.json +9 -0
- package/test/concepts/validation-rule/validation-rule.spec.ts +15 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
import MemberExpression from './MemberExpression__';
|
|
5
5
|
import StructureProperty from './StructureProperty__';
|
|
@@ -1167,7 +1167,7 @@ export class NewComposite extends LogicItem {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
|
|
1169
1169
|
@withSourceMap()
|
|
1170
|
-
toEmbeddedTS(state
|
|
1170
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
1171
1171
|
const indent0 = indent(state?.tabSize || 0);
|
|
1172
1172
|
const indent1 = indent((state?.tabSize || 0) + 1);
|
|
1173
1173
|
const indent2 = indent((state?.tabSize || 0) + 2);
|
|
@@ -1325,7 +1325,7 @@ export class NewComposite extends LogicItem {
|
|
|
1325
1325
|
}
|
|
1326
1326
|
|
|
1327
1327
|
@withSourceMap()
|
|
1328
|
-
toNaturalTS(state
|
|
1328
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
1329
1329
|
const indent0 = indent((state?.tabSize || 0));
|
|
1330
1330
|
const indent1 = indent((state?.tabSize || 0) + 1);
|
|
1331
1331
|
const indent2 = indent((state?.tabSize || 0) + 2);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
import AnonymousFunction from './AnonymousFunction__';
|
|
4
4
|
import { ElementToVueOptions } from './ViewElement__';
|
|
5
5
|
//= ===============================================================================
|
|
@@ -378,7 +378,7 @@ export class NewList extends LogicItem {
|
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
@withSourceMap()
|
|
381
|
-
toEmbeddedTS(state
|
|
381
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
382
382
|
const indent0 = indent(state?.tabSize || 0);
|
|
383
383
|
const indent1 = indent((state?.tabSize || 0) + 1);
|
|
384
384
|
const indent2 = indent((state?.tabSize || 0) + 2);
|
|
@@ -447,7 +447,7 @@ export class NewList extends LogicItem {
|
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
@withSourceMap()
|
|
450
|
-
toNaturalTS(state
|
|
450
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
451
451
|
const indent0 = indent((state?.tabSize || 0));
|
|
452
452
|
let code = '';
|
|
453
453
|
if (this.typeAnnotation) {
|
package/src/concepts/NewMap__.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
//= ===============================================================================
|
|
5
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -584,7 +584,7 @@ export class NewMap extends LogicItem {
|
|
|
584
584
|
}
|
|
585
585
|
|
|
586
586
|
@withSourceMap()
|
|
587
|
-
toEmbeddedTS(state
|
|
587
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
588
588
|
const indent0 = indent(state?.tabSize || 0);
|
|
589
589
|
const indent1 = indent((state?.tabSize || 0) + 1);
|
|
590
590
|
const indent2 = indent((state?.tabSize || 0) + 2);
|
|
@@ -678,7 +678,7 @@ export class NewMap extends LogicItem {
|
|
|
678
678
|
}
|
|
679
679
|
|
|
680
680
|
@withSourceMap()
|
|
681
|
-
toNaturalTS(state
|
|
681
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
682
682
|
let code = '';
|
|
683
683
|
if (this.typeAnnotation) {
|
|
684
684
|
code += `new ${this.typeAnnotation.sortedTypeKey}()`;
|
package/src/concepts/New__.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
//= ===============================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -51,7 +51,7 @@ export class New extends LogicItem {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
@withSourceMap()
|
|
54
|
-
toEmbeddedTS(state
|
|
54
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
55
55
|
const code = '__IDENTIFIER__';
|
|
56
56
|
return code;
|
|
57
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
|
|
5
5
|
//= ===============================================================================
|
|
@@ -64,7 +64,7 @@ export class NullLiteral extends LogicItem {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
@withSourceMap()
|
|
67
|
-
toEmbeddedTS(state
|
|
67
|
+
toEmbeddedTS(state = createCompilerState()) {
|
|
68
68
|
return 'null';
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
|
|
5
5
|
//= ===============================================================================
|
|
@@ -129,7 +129,7 @@ export class NumericLiteral extends LogicItem {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
@withSourceMap()
|
|
132
|
-
toEmbeddedTS(state
|
|
132
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
133
133
|
const type = `${this.typeAnnotation.typeNamespace}.${this.typeAnnotation.typeName}`;
|
|
134
134
|
const code = this.value ? `new ${type}(${this.value})` : '__IDENTIFIER__';
|
|
135
135
|
return code;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
import { getNodeByNodeCallee, getNaslNodeByNodeCallee } from '../automate/engine/utils';
|
|
4
4
|
import StructureProperty from './StructureProperty__';
|
|
5
5
|
import Structure from './Structure__';
|
|
@@ -229,7 +229,7 @@ export class OqlQueryComponent extends LogicItem {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
@withSourceMap()
|
|
232
|
-
toEmbeddedTS(state
|
|
232
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
233
233
|
let code: string;
|
|
234
234
|
const { typeAnnotation } = this;
|
|
235
235
|
if (typeAnnotation) {
|
|
@@ -290,7 +290,7 @@ export class OqlQueryComponent extends LogicItem {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
@withSourceMap()
|
|
293
|
-
toNaturalTS(state
|
|
293
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
294
294
|
const code: string = `nasl.oql.query(\`${this.code}\`)`;
|
|
295
295
|
return code;
|
|
296
296
|
}
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
2
|
import { dataTypesMap } from './basics/types';
|
|
3
|
-
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
3
|
+
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
4
4
|
import LogicItem from './LogicItem__';
|
|
5
5
|
import EntityProperty from './EntityProperty__';
|
|
6
6
|
import Structure from './Structure__';
|
|
@@ -386,7 +386,7 @@ export class Param extends BaseNode {
|
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
@withSourceMap()
|
|
389
|
-
toNaturalTS(state
|
|
389
|
+
toNaturalTS(state = createCompilerState(), dontType?: boolean): string {
|
|
390
390
|
let code = this.name;
|
|
391
391
|
// 回调函数类的参数
|
|
392
392
|
if (this?.typeAnnotation?.typeKind === 'function') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
import {
|
|
4
4
|
genUserTaskLogic,
|
|
5
5
|
getPreviousTask,
|
|
@@ -1660,7 +1660,7 @@ export class ProcessElement extends BaseNode {
|
|
|
1660
1660
|
}
|
|
1661
1661
|
|
|
1662
1662
|
@withSourceMap()
|
|
1663
|
-
toEmbeddedTS(state
|
|
1663
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
1664
1664
|
// this.syncLogic();
|
|
1665
1665
|
const tab0 = indent(state?.tabSize || 0);
|
|
1666
1666
|
const tab1 = indent((state?.tabSize || 0) + 1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
|
|
4
4
|
//= ===============================================================================
|
|
5
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -71,7 +71,7 @@ export class ProcessOutcome extends LogicItem {
|
|
|
71
71
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
72
72
|
//= ===============================================================================
|
|
73
73
|
@withSourceMap()
|
|
74
|
-
toEmbeddedTS(state
|
|
74
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
75
75
|
const code = `return () => ${this.flowRef ? `"${this.flowRef}"` : '__IDENTIFIER__'}`;
|
|
76
76
|
return code;
|
|
77
77
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
//= ===============================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -70,7 +70,7 @@ export class ProcessOutcomes extends LogicItem {
|
|
|
70
70
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
71
71
|
//= ===============================================================================
|
|
72
72
|
@withSourceMap()
|
|
73
|
-
toEmbeddedTS(state
|
|
73
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
74
74
|
const code = `return () => ${this.flowRefs?.length > 0 ? `"${this.flowRefs}"` : '__IDENTIFIER__'}`;
|
|
75
75
|
return code;
|
|
76
76
|
}
|
|
@@ -1294,7 +1294,7 @@ export class Process extends BaseNode {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
|
|
1296
1296
|
@withSourceMap()
|
|
1297
|
-
toEmbeddedTS(state
|
|
1297
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
1298
1298
|
let code = `export namespace ${this.name} {\n`;
|
|
1299
1299
|
const tab0 = indent(state?.tabSize || 0);
|
|
1300
1300
|
const tab1 = indent((state?.tabSize || 0) + 1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
//= ===============================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -122,7 +122,7 @@ export class QueryAggregateExpression extends LogicItem {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
@withSourceMap()
|
|
125
|
-
toEmbeddedTS(state
|
|
125
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
126
126
|
// const { aggregateName, aggregateParam, asName } = this;
|
|
127
127
|
// let code = '';
|
|
128
128
|
// if (aggregateName && aggregateParam) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
import CallQueryComponent from './CallQueryComponent__';
|
|
4
4
|
//= ===============================================================================
|
|
5
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -132,7 +132,7 @@ export class QueryFieldExpression extends LogicItem {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
@withSourceMap()
|
|
135
|
-
toEmbeddedTS(state
|
|
135
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
136
136
|
const { entityAsName, propertyName, isDotStar } = this;
|
|
137
137
|
const callQueryComponent = this.getAncestor('CallQueryComponent') as CallQueryComponent;
|
|
138
138
|
if (callQueryComponent) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
import type CallQueryComponent from './CallQueryComponent__';
|
|
4
4
|
//= ===============================================================================
|
|
5
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -247,7 +247,7 @@ export class QueryFromExpression extends LogicItem {
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
@withSourceMap()
|
|
250
|
-
toEmbeddedTS(state
|
|
250
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
251
251
|
let code = '';
|
|
252
252
|
code += `nasl.langUtil.FROM(new nasl.langUtil.Collection<[${this.entityKey}]>()`;
|
|
253
253
|
if (this.joinParts.length) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
import CallQueryComponent from './CallQueryComponent__';
|
|
4
4
|
//= ===============================================================================
|
|
5
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -439,7 +439,7 @@ export class QueryJoinExpression extends LogicItem {
|
|
|
439
439
|
}
|
|
440
440
|
|
|
441
441
|
@withSourceMap()
|
|
442
|
-
toEmbeddedTS(state
|
|
442
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
443
443
|
let code = '';
|
|
444
444
|
code += `.${this.joinType}_JOIN(new nasl.langUtil.Collection<[${this.entityKey}]>())\n`;
|
|
445
445
|
if (this.onExpressions.length > 0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
//= ===============================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -162,7 +162,7 @@ export class QueryLimitExpression extends LogicItem {
|
|
|
162
162
|
//= ===============================================================================
|
|
163
163
|
|
|
164
164
|
@withSourceMap()
|
|
165
|
-
toEmbeddedTS(state
|
|
165
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
166
166
|
const { pageElement, pageSizeElement } = this;
|
|
167
167
|
let code = '[';
|
|
168
168
|
code += `${pageElement.toEmbeddedTS(shiftState(state, code))}, `;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
//= ===============================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -176,7 +176,7 @@ export class QueryOrderByExpression extends LogicItem {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
@withSourceMap()
|
|
179
|
-
toEmbeddedTS(state
|
|
179
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
180
180
|
const { orderElement, order } = this;
|
|
181
181
|
let code = '[';
|
|
182
182
|
code += `${orderElement.toEmbeddedTS(shiftState(state, code))}, `;
|
package/src/concepts/Return__.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
2
|
import { dataTypesMap } from './basics/types';
|
|
3
|
-
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
3
|
+
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
4
4
|
import EntityProperty from './EntityProperty__';
|
|
5
5
|
import StructureProperty from './StructureProperty__';
|
|
6
6
|
import Structure from './Structure__';
|
|
@@ -294,7 +294,7 @@ export class Return extends BaseNode {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
@withSourceMap()
|
|
297
|
-
toEmbeddedTS(state
|
|
297
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
298
298
|
let code = this.name || '__return';
|
|
299
299
|
if (this.typeAnnotation) {
|
|
300
300
|
code += ': ';
|
|
@@ -315,7 +315,7 @@ export class Return extends BaseNode {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
@withSourceMap()
|
|
318
|
-
toNaturalTS(state
|
|
318
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
319
319
|
let code = this.name || '__return';
|
|
320
320
|
if (this.typeAnnotation) {
|
|
321
321
|
code += ': ';
|
package/src/concepts/Role__.ts
CHANGED
|
@@ -103,7 +103,7 @@ export class Role extends BaseNode {
|
|
|
103
103
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
104
104
|
//= ===============================================================================
|
|
105
105
|
@withSourceMap()
|
|
106
|
-
toEmbeddedTS(state
|
|
106
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
107
107
|
let code = `export enum ${this.tsName} {\n`;
|
|
108
108
|
code += ` ${this.tsName}='${this.tsName}'\n`;
|
|
109
109
|
code += `${indent(state?.tabSize || 0)}}\n`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
import BatchAssignment from './BatchAssignment__';
|
|
4
4
|
import AssignmentLine from './AssignmentLine__';
|
|
5
5
|
//= ===============================================================================
|
|
@@ -371,7 +371,7 @@ export class SelectMembers extends BaseNode {
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
@withSourceMap()
|
|
374
|
-
toEmbeddedTS(state
|
|
374
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
375
375
|
const code = '';
|
|
376
376
|
return code;
|
|
377
377
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
import { getNodeByNodeCallee, getNaslNodeByNodeCallee } from '../automate/engine/utils';
|
|
4
4
|
import StructureProperty from './StructureProperty__';
|
|
5
5
|
import Structure from './Structure__';
|
|
@@ -229,7 +229,7 @@ export class SqlQueryComponent extends LogicItem {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
@withSourceMap()
|
|
232
|
-
toEmbeddedTS(state
|
|
232
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
233
233
|
let code: string;
|
|
234
234
|
if (this.ideVersion === '2.11') {
|
|
235
235
|
code = `(function(): `;
|
|
@@ -258,7 +258,7 @@ export class SqlQueryComponent extends LogicItem {
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
@withSourceMap()
|
|
261
|
-
toNaturalTS(state
|
|
261
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
262
262
|
const code: string = `nasl.oql.query(\`${this.code}\`)`;
|
|
263
263
|
return code;
|
|
264
264
|
}
|
package/src/concepts/Start__.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
//= ===============================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -57,7 +57,7 @@ export class Start extends LogicItem {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
@withSourceMap()
|
|
60
|
-
toEmbeddedTS(state
|
|
60
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
61
61
|
return '';
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
import { StringLiteral } from './StringLiteral__';
|
|
5
5
|
//= ===============================================================================
|
|
@@ -309,7 +309,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
@withSourceMap()
|
|
312
|
-
toEmbeddedTS(state
|
|
312
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
313
313
|
let code = 'nasl.util.stringInterpolation(';
|
|
314
314
|
this.expressions.forEach((exp, idx) => {
|
|
315
315
|
code += exp.toEmbeddedTS(shiftState(state, code));
|
|
@@ -322,7 +322,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
@withSourceMap()
|
|
325
|
-
toNaturalTS(state
|
|
325
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
326
326
|
let code = '`';
|
|
327
327
|
this.expressions.forEach((exp) => {
|
|
328
328
|
if (exp.concept === 'StringLiteral') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
//= ===============================================================================
|
|
5
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -105,7 +105,7 @@ export class StringLiteral extends LogicItem {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
@withSourceMap()
|
|
108
|
-
toNaturalTS(state
|
|
108
|
+
toNaturalTS(state = createCompilerState(), isRequired?: boolean): string {
|
|
109
109
|
return `'${this.value}'`;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
2
|
import { dataTypesMap } from './basics/types';
|
|
3
|
-
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
3
|
+
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
4
4
|
import { getNodeByNodeCallee, getNaslNodeByNodeCallee } from '../automate/engine/utils';
|
|
5
5
|
//= ===============================================================================
|
|
6
6
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -255,7 +255,7 @@ export class StructureProperty extends BaseNode {
|
|
|
255
255
|
isLeaf: boolean = true;
|
|
256
256
|
|
|
257
257
|
@withSourceMap()
|
|
258
|
-
toEmbeddedTS(state
|
|
258
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
259
259
|
let code = this.name;
|
|
260
260
|
if (this.typeAnnotation) {
|
|
261
261
|
code += ': ';
|
|
@@ -269,7 +269,7 @@ export class StructureProperty extends BaseNode {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
@withSourceMap()
|
|
272
|
-
toNaturalTS(state
|
|
272
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
273
273
|
let code = this.name;
|
|
274
274
|
if (this.typeAnnotation) {
|
|
275
275
|
code += ': ';
|
|
@@ -557,7 +557,7 @@ export class Structure extends BaseNode {
|
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
@withSourceMap()
|
|
560
|
-
toEmbeddedTS(state
|
|
560
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
561
561
|
let code = `export class ${this.tsName} {\n`;
|
|
562
562
|
code += indent((state?.tabSize || 0) + 1);
|
|
563
563
|
code += `__name: '${this.getTsNamespace()}.${this.tsName}';\n`;
|
|
@@ -572,7 +572,7 @@ export class Structure extends BaseNode {
|
|
|
572
572
|
}
|
|
573
573
|
|
|
574
574
|
@withSourceMap()
|
|
575
|
-
toNaturalTS(state
|
|
575
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
576
576
|
let code = `class ${this.name} {\n`;
|
|
577
577
|
// code += `${indent(state.tabSize + 1)}__name: '${this.getNamespace()}.${this.name}';\n`;
|
|
578
578
|
this.properties.forEach((property) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
3
|
//= ===============================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -314,7 +314,7 @@ export class SwitchCase extends LogicItem {
|
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
@withSourceMap()
|
|
317
|
-
toNaturalTS(state
|
|
317
|
+
toNaturalTS(state = createCompilerState(), isLast?: boolean, isFirst?: boolean): string {
|
|
318
318
|
let code = '\n';
|
|
319
319
|
if (!isLast) {
|
|
320
320
|
code += indent(state.tabSize + 2);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
3
3
|
|
|
4
4
|
//= ===============================================================================
|
|
5
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -218,7 +218,7 @@ export class SwitchStatement extends LogicItem {
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
@withSourceMap()
|
|
221
|
-
toEmbeddedTS(state
|
|
221
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
222
222
|
let code = '';
|
|
223
223
|
// 最后一项是else
|
|
224
224
|
this.cases.forEach((item, index) => {
|
|
@@ -233,7 +233,7 @@ export class SwitchStatement extends LogicItem {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
@withSourceMap()
|
|
236
|
-
toNaturalTS(state
|
|
236
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
237
237
|
let code = '';
|
|
238
238
|
// 最后一项是else
|
|
239
239
|
this.cases.forEach((item, index) => {
|
|
@@ -201,7 +201,7 @@ export class TriggerLauncher extends BaseNode {
|
|
|
201
201
|
//= ===============================================================================
|
|
202
202
|
|
|
203
203
|
@withSourceMap()
|
|
204
|
-
toEmbeddedTS(state
|
|
204
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
205
205
|
let code = '';
|
|
206
206
|
code += `export function ${this.name} () {\n`;
|
|
207
207
|
try {
|