@lcap/nasl 3.3.0-alpha.1 → 3.3.0-alpha.2
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/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__.js +2 -2
- 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__.js +1 -1
- 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 +2 -2
- package/out/concepts/CallLogic__.js.map +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/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 +2 -2
- 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 +1 -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__.js +2 -2
- package/out/concepts/MemberExpression__.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__.js +2 -2
- 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__.js +1 -1
- 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__.js +1 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +2 -2
- 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/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/natural/knowledgeMap.js +12 -12
- package/out/natural/knowledgeMap.js.map +1 -1
- package/package.json +2 -1
- 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 +3 -3
- package/src/concepts/BindDirective__.ts +2 -2
- package/src/concepts/BindEvent__.ts +1 -1
- 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 +3 -3
- 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 +1 -1
- 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 +3 -3
- 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 +1 -1
- package/src/concepts/MatchCase__.ts +2 -2
- package/src/concepts/Match__.ts +3 -3
- package/src/concepts/MemberExpression__.ts +3 -3
- 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 +3 -3
- package/src/concepts/TypeParam__.ts +2 -2
- package/src/concepts/UnaryExpression__.ts +3 -3
- package/src/concepts/ValidationRule__.ts +2 -2
- package/src/concepts/Variable__.ts +3 -3
- package/src/concepts/ViewElement__.ts +2 -2
- package/src/concepts/View__.ts +2 -2
- package/src/concepts/WhileStatement__.ts +3 -3
- package/src/index.ts +1 -0
- package/src/natural/knowledgeMap.ts +12 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
2
|
import View from './View__';
|
|
3
3
|
import { getNodeByNodeCallee } from '../automate/engine/utils';
|
|
4
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
4
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
5
5
|
import { ElementToVueOptions } from './ViewElement__';
|
|
6
6
|
import { BindAttribute, Param } from '..';
|
|
7
7
|
|
|
@@ -690,7 +690,7 @@ export class Destination extends LogicItem {
|
|
|
690
690
|
}
|
|
691
691
|
|
|
692
692
|
@withSourceMap()
|
|
693
|
-
toEmbeddedTS(state
|
|
693
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
694
694
|
let code = '';
|
|
695
695
|
|
|
696
696
|
const node = this.viewNode;
|
|
@@ -745,7 +745,7 @@ export class Destination extends LogicItem {
|
|
|
745
745
|
|
|
746
746
|
|
|
747
747
|
@withSourceMap()
|
|
748
|
-
toNaturalTS(state
|
|
748
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
749
749
|
let code = '';
|
|
750
750
|
|
|
751
751
|
const node = this.viewNode;
|
package/src/concepts/End__.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, indent, createCompilerState } from '../translator';
|
|
3
3
|
import Return from './Return__';
|
|
4
4
|
import Logic from './Logic__';
|
|
5
5
|
//= ===============================================================================
|
|
@@ -64,7 +64,7 @@ export class End extends LogicItem {
|
|
|
64
64
|
return code;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
toEmbeddedTS(state
|
|
67
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
68
68
|
let code = '';
|
|
69
69
|
let ret;
|
|
70
70
|
let logic;
|
|
@@ -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
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -180,7 +180,7 @@ export class EntityIndex extends BaseNode {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
@withSourceMap()
|
|
183
|
-
toEmbeddedTS(state
|
|
183
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
184
184
|
return `{ ${this.name}: [${this.propertyNames.map((item) => `this.${item}`).join(', ')}] },`;
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
2
|
import { dataTypesMap } from './basics/types';
|
|
3
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
3
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
4
4
|
import { getNodeByNodeCallee, getNaslNodeByNodeCallee } from '../automate/engine/utils';
|
|
5
5
|
import CallQueryComponent from './CallQueryComponent__';
|
|
6
6
|
import StructureProperty from './StructureProperty__';
|
|
@@ -575,7 +575,7 @@ export class EntityProperty extends BaseNode {
|
|
|
575
575
|
}
|
|
576
576
|
|
|
577
577
|
@withSourceMap()
|
|
578
|
-
toEmbeddedTS(state
|
|
578
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
579
579
|
let code = '';
|
|
580
580
|
if (this.relationNamespace && this.relationEntity && this.relationProperty) {
|
|
581
581
|
code += `@nasl.annotation.EntityRelation(new ${this.relationNamespace}.${this.relationEntity}().${this.relationProperty})\n`;
|
|
@@ -595,7 +595,7 @@ export class EntityProperty extends BaseNode {
|
|
|
595
595
|
}
|
|
596
596
|
|
|
597
597
|
@withSourceMap()
|
|
598
|
-
toNaturalTS(state
|
|
598
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
599
599
|
let code = '';
|
|
600
600
|
if (this.relationNamespace && this.relationEntity && this.relationProperty) {
|
|
601
601
|
code += `@EntityRelation(() => new ${this.relationEntity}().${this.relationProperty})\n`;
|
package/src/concepts/Entity__.ts
CHANGED
|
@@ -809,7 +809,7 @@ export class Entity extends BaseNode {
|
|
|
809
809
|
}
|
|
810
810
|
|
|
811
811
|
@withSourceMap()
|
|
812
|
-
toEmbeddedTS(state
|
|
812
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
813
813
|
let code = `export class ${this.name} {\n`;
|
|
814
814
|
code += indent((state?.tabSize || 0) + 1);
|
|
815
815
|
code += `__name: '${this.getNamespace()}.${this.name}';\n`;
|
|
@@ -848,7 +848,7 @@ export class Entity extends BaseNode {
|
|
|
848
848
|
}
|
|
849
849
|
|
|
850
850
|
@withSourceMap()
|
|
851
|
-
toNaturalTS(state
|
|
851
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
852
852
|
let code = `class ${this.name} {\n`;
|
|
853
853
|
// code += `${indent(state.tabSize + 1)}__name: '${this.getNamespace()}.${this.name}';\n`;
|
|
854
854
|
this.properties.forEach((property) => {
|
|
@@ -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
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -123,12 +123,12 @@ export class EnumItem extends BaseNode {
|
|
|
123
123
|
expression: undefined;
|
|
124
124
|
|
|
125
125
|
@withSourceMap()
|
|
126
|
-
toEmbeddedTS(state
|
|
126
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
127
127
|
return `static '${this.value}': ${this.enumeration.name}`;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
@withSourceMap()
|
|
131
|
-
toNaturalTS(state
|
|
131
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
132
132
|
return `'${this.value}' = '${this.label}'`;
|
|
133
133
|
}
|
|
134
134
|
|
package/src/concepts/Enum__.ts
CHANGED
|
@@ -295,7 +295,7 @@ export class Enum extends BaseNode {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
@withSourceMap()
|
|
298
|
-
toEmbeddedTS(state
|
|
298
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
299
299
|
let code = `export class ${this.name} extends nasl.core.Enums {\n`;
|
|
300
300
|
// 增加一个单独的标签
|
|
301
301
|
code += `${indent((state?.tabSize || 0) + 1)}__name: '${this.getNamespace()}.${this.name}';\n`;
|
|
@@ -316,7 +316,7 @@ export class Enum extends BaseNode {
|
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
@withSourceMap()
|
|
319
|
-
toNaturalTS(state
|
|
319
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
320
320
|
let code = `enum ${this.name} {\n`;
|
|
321
321
|
this.enumItems.forEach((property) => {
|
|
322
322
|
code += indent(state.tabSize + 1);
|
|
@@ -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 TypeAnnotation from './TypeAnnotation__';
|
|
4
4
|
import Identifier from './Identifier__';
|
|
5
5
|
import MemberExpression from './MemberExpression__';
|
|
@@ -529,7 +529,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
@withSourceMap()
|
|
532
|
-
toEmbeddedTS(state
|
|
532
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
533
533
|
let code = '';
|
|
534
534
|
code += this.each
|
|
535
535
|
? this.each.toEmbeddedTS(
|
|
@@ -572,7 +572,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
572
572
|
}
|
|
573
573
|
|
|
574
574
|
@withSourceMap()
|
|
575
|
-
toNaturalTS(state
|
|
575
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
576
576
|
let code = '';
|
|
577
577
|
code += this.each
|
|
578
578
|
? this.each.toNaturalTS(
|
|
@@ -1162,7 +1162,7 @@ export class Frontend extends BaseNode {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
|
|
1164
1164
|
@withSourceMap()
|
|
1165
|
-
toEmbeddedTS(state
|
|
1165
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
1166
1166
|
let code = `export namespace ${this.name} {\n`;
|
|
1167
1167
|
code += 'const name = ';
|
|
1168
1168
|
code += `"${this.name}";\n`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
2
|
import Namespace from './Namespace__';
|
|
3
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
3
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
4
4
|
import { ElementToVueOptions } from './ViewElement__';
|
|
5
5
|
import asyncFuncMap from '../common/asyncFuncMap';
|
|
6
6
|
|
|
@@ -1047,7 +1047,7 @@ export class Function extends BaseNode {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
1049
|
@withSourceMap()
|
|
1050
|
-
toEmbeddedTS(state
|
|
1050
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
1051
1051
|
let code = '';
|
|
1052
1052
|
if (this.returnExpression) {
|
|
1053
1053
|
code += `(`;
|
|
@@ -1074,7 +1074,7 @@ export class Function extends BaseNode {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
|
|
1076
1076
|
@withSourceMap()
|
|
1077
|
-
toNaturalTS(state
|
|
1077
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
1078
1078
|
let code = '';
|
|
1079
1079
|
if (this.returnExpression) {
|
|
1080
1080
|
code += `(`;
|
|
@@ -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 { BindAttribute, CallLogic, TypeAnnotation } from '..';
|
|
4
4
|
import { ElementToVueOptions } from './ViewElement__';
|
|
5
5
|
import { findConceptKeyWordByNamespace } from '../utils';
|
|
@@ -201,7 +201,7 @@ export class Identifier extends LogicItem {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
@withSourceMap()
|
|
204
|
-
toEmbeddedTS(state
|
|
204
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
205
205
|
// 只有data-source可以是函数 ,也可能是属性
|
|
206
206
|
if (this.parentNode instanceof BindAttribute && this.parentNode.name === 'data-source') {
|
|
207
207
|
const { view } = this;
|
|
@@ -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
|
//= ===============================================================================
|
|
5
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -417,7 +417,7 @@ export class IfStatement extends LogicItem {
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
@withSourceMap()
|
|
420
|
-
toEmbeddedTS(state
|
|
420
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
421
421
|
let code = '';
|
|
422
422
|
code += 'if (nasl.core.ensureBoolean(';
|
|
423
423
|
code += this.test
|
|
@@ -456,7 +456,7 @@ export class IfStatement extends LogicItem {
|
|
|
456
456
|
}
|
|
457
457
|
|
|
458
458
|
@withSourceMap()
|
|
459
|
-
toNaturalTS(state
|
|
459
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
460
460
|
let code = '';
|
|
461
461
|
code += 'if (';
|
|
462
462
|
code += this.test ? this.test.toNaturalTS(shiftState(state, code, {
|
|
@@ -896,7 +896,7 @@ export class Interface extends BaseNode {
|
|
|
896
896
|
}
|
|
897
897
|
|
|
898
898
|
@withSourceMap()
|
|
899
|
-
toEmbeddedTS(state
|
|
899
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
900
900
|
let code = '';
|
|
901
901
|
const getCheckerCode = () => {
|
|
902
902
|
if (this.validation) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { withSourceMap, TranslatorState } from '../translator';
|
|
2
|
+
import { withSourceMap, TranslatorState, createCompilerState } from '../translator';
|
|
3
3
|
//= ===============================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -80,7 +80,7 @@ export class JSBlock extends LogicItem {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
@withSourceMap()
|
|
83
|
-
toEmbeddedTS(state
|
|
83
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
84
84
|
return 'nasl.core.universalVariable';
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState, indent } from '../translator';
|
|
2
|
+
import { TranslatorState, indent, createCompilerState } from '../translator';
|
|
3
3
|
//= ===============================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -81,7 +81,7 @@ export class JavaLogic extends LogicItem {
|
|
|
81
81
|
* @param state 编译状态
|
|
82
82
|
* @returns 生成的代码
|
|
83
83
|
*/
|
|
84
|
-
toEmbeddedTS(state
|
|
84
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
85
85
|
let code = '';
|
|
86
86
|
const ret = this.logic.returns[0];
|
|
87
87
|
if (ret) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { TranslatorState } from '../translator';
|
|
2
|
+
import { TranslatorState, createCompilerState } from '../translator';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
import CallQueryComponent from './CallQueryComponent__';
|
|
5
5
|
import CallInterface from './CallInterface__';
|
|
@@ -330,7 +330,7 @@ export class LogicItem extends BaseNode {
|
|
|
330
330
|
* @param state 编译状态
|
|
331
331
|
* @returns 生成的代码
|
|
332
332
|
*/
|
|
333
|
-
toEmbeddedTS(state
|
|
333
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
334
334
|
return this.toJS(state);
|
|
335
335
|
}
|
|
336
336
|
|
|
@@ -339,7 +339,7 @@ export class LogicItem extends BaseNode {
|
|
|
339
339
|
* @param state 编译状态
|
|
340
340
|
* @returns 生成的代码
|
|
341
341
|
*/
|
|
342
|
-
toNaturalTS(state
|
|
342
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
343
343
|
return this.toEmbeddedTS(state);
|
|
344
344
|
}
|
|
345
345
|
|
package/src/concepts/Logic__.ts
CHANGED
|
@@ -1884,7 +1884,7 @@ export class Logic extends BaseNode {
|
|
|
1884
1884
|
}
|
|
1885
1885
|
|
|
1886
1886
|
@withSourceMap()
|
|
1887
|
-
toNaturalTS(state
|
|
1887
|
+
toNaturalTS(state = createCompilerState(), prefix?: string, logicName?: string): string {
|
|
1888
1888
|
if (!logicName) {
|
|
1889
1889
|
if (this.parentNode instanceof BindEvent && this.parentNode.parentNode instanceof View) {
|
|
1890
1890
|
logicName = `on_view_${this.name}`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
-
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
3
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
4
4
|
import Match from './Match__';
|
|
5
5
|
import MemberExpression from './MemberExpression__';
|
|
6
6
|
import BooleanLiteral from './BooleanLiteral__';
|
|
@@ -842,7 +842,7 @@ export class MatchCase extends LogicItem {
|
|
|
842
842
|
|
|
843
843
|
|
|
844
844
|
@withSourceMap()
|
|
845
|
-
toNaturalTS(state
|
|
845
|
+
toNaturalTS(state = createCompilerState(), index?: number, parentCode?: string): string {
|
|
846
846
|
let code = '\n';
|
|
847
847
|
|
|
848
848
|
const parentNode = (this.parentNode as Match);
|
package/src/concepts/Match__.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 TypeAnnotation, { isUnion } from './TypeAnnotation__';
|
|
4
4
|
import BooleanLiteral from './BooleanLiteral__';
|
|
5
5
|
import MemberExpression from './MemberExpression__';
|
|
@@ -675,7 +675,7 @@ export class Match extends LogicItem {
|
|
|
675
675
|
}
|
|
676
676
|
|
|
677
677
|
@withSourceMap()
|
|
678
|
-
toEmbeddedTS(state
|
|
678
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
679
679
|
let code = '';
|
|
680
680
|
|
|
681
681
|
if (this.parentNode.concept === 'Logic') {
|
|
@@ -733,7 +733,7 @@ export class Match extends LogicItem {
|
|
|
733
733
|
}
|
|
734
734
|
|
|
735
735
|
@withSourceMap()
|
|
736
|
-
toNaturalTS(state
|
|
736
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
737
737
|
let code = '';
|
|
738
738
|
|
|
739
739
|
if (this.parentNode?.concept === 'Logic') {
|
|
@@ -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 { Enum, TypeAnnotation } from '..';
|
|
4
4
|
import { ElementToVueOptions } from './ViewElement__';
|
|
5
5
|
import Identifier from './Identifier__';
|
|
@@ -324,7 +324,7 @@ export class MemberExpression extends LogicItem {
|
|
|
324
324
|
* @returns
|
|
325
325
|
*/
|
|
326
326
|
@withSourceMap()
|
|
327
|
-
toEmbeddedTS(state
|
|
327
|
+
toEmbeddedTS(state = createCompilerState()): string {
|
|
328
328
|
let code = '';
|
|
329
329
|
const leftCode = this.object ? `${this.object.toEmbeddedTS(shiftState(state, code, { inline: true }))}.` : '';
|
|
330
330
|
code += this.object ? `${this.object.toEmbeddedTS(shiftState(state, code, { inline: true }))}.` : '';
|
|
@@ -341,7 +341,7 @@ export class MemberExpression extends LogicItem {
|
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
@withSourceMap()
|
|
344
|
-
toNaturalTS(state
|
|
344
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
345
345
|
let code = '';
|
|
346
346
|
const leftCode = this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '';
|
|
347
347
|
code += this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '';
|
|
@@ -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);
|