@abaplint/core 2.111.1 → 2.112.1
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/build/abaplint.d.ts +17 -8
- package/build/src/abap/5_syntax/_builtin.js +2 -2
- package/build/src/abap/5_syntax/_current_scope.js +2 -0
- package/build/src/abap/5_syntax/_procedural.js +6 -2
- package/build/src/abap/5_syntax/_syntax_input.js +11 -0
- package/build/src/abap/5_syntax/assert_error.js +7 -0
- package/build/src/abap/5_syntax/basic_types.js +78 -79
- package/build/src/abap/5_syntax/expressions/attribute_chain.js +15 -8
- package/build/src/abap/5_syntax/expressions/attribute_name.js +24 -11
- package/build/src/abap/5_syntax/expressions/cast.js +24 -13
- package/build/src/abap/5_syntax/expressions/compare.js +4 -4
- package/build/src/abap/5_syntax/expressions/component_chain.js +26 -11
- package/build/src/abap/5_syntax/expressions/component_compare.js +7 -4
- package/build/src/abap/5_syntax/expressions/component_compare_simple.js +11 -6
- package/build/src/abap/5_syntax/expressions/component_cond.js +3 -3
- package/build/src/abap/5_syntax/expressions/component_name.js +10 -5
- package/build/src/abap/5_syntax/expressions/cond.js +3 -6
- package/build/src/abap/5_syntax/expressions/cond_body.js +6 -6
- package/build/src/abap/5_syntax/expressions/conv_body.js +9 -8
- package/build/src/abap/5_syntax/expressions/corresponding_body.js +3 -3
- package/build/src/abap/5_syntax/expressions/data_definition.js +7 -7
- package/build/src/abap/5_syntax/expressions/database_table.js +9 -7
- package/build/src/abap/5_syntax/expressions/default.js +2 -2
- package/build/src/abap/5_syntax/expressions/dereference.js +5 -2
- package/build/src/abap/5_syntax/expressions/dynamic.js +2 -2
- package/build/src/abap/5_syntax/expressions/field_assignment.js +12 -5
- package/build/src/abap/5_syntax/expressions/field_chain.js +40 -25
- package/build/src/abap/5_syntax/expressions/field_length.js +2 -2
- package/build/src/abap/5_syntax/expressions/field_offset.js +2 -2
- package/build/src/abap/5_syntax/expressions/filter_body.js +3 -3
- package/build/src/abap/5_syntax/expressions/for.js +11 -11
- package/build/src/abap/5_syntax/expressions/form_param.js +10 -9
- package/build/src/abap/5_syntax/expressions/fstarget.js +8 -5
- package/build/src/abap/5_syntax/expressions/inline_data.js +11 -8
- package/build/src/abap/5_syntax/expressions/inline_field_definition.js +12 -8
- package/build/src/abap/5_syntax/expressions/inline_fs.js +7 -7
- package/build/src/abap/5_syntax/expressions/inline_loop_definition.js +16 -11
- package/build/src/abap/5_syntax/expressions/let.js +3 -3
- package/build/src/abap/5_syntax/expressions/loop_group_by.js +5 -15
- package/build/src/abap/5_syntax/expressions/message_source.js +4 -4
- package/build/src/abap/5_syntax/expressions/method_call_body.js +4 -4
- package/build/src/abap/5_syntax/expressions/method_call_chain.js +34 -25
- package/build/src/abap/5_syntax/expressions/method_call_param.js +33 -14
- package/build/src/abap/5_syntax/expressions/method_def_returning.js +7 -6
- package/build/src/abap/5_syntax/expressions/method_param.js +11 -10
- package/build/src/abap/5_syntax/expressions/method_parameters.js +76 -49
- package/build/src/abap/5_syntax/expressions/method_source.js +47 -38
- package/build/src/abap/5_syntax/expressions/new_object.js +48 -28
- package/build/src/abap/5_syntax/expressions/raise_with.js +2 -2
- package/build/src/abap/5_syntax/expressions/reduce_body.js +10 -10
- package/build/src/abap/5_syntax/expressions/reduce_next.js +3 -3
- package/build/src/abap/5_syntax/expressions/select.js +48 -33
- package/build/src/abap/5_syntax/expressions/select_loop.js +2 -2
- package/build/src/abap/5_syntax/expressions/source.js +74 -64
- package/build/src/abap/5_syntax/expressions/source_field.js +12 -6
- package/build/src/abap/5_syntax/expressions/source_field_symbol.js +8 -4
- package/build/src/abap/5_syntax/expressions/sql_compare.js +11 -19
- package/build/src/abap/5_syntax/expressions/sql_for_all_entries.js +7 -4
- package/build/src/abap/5_syntax/expressions/sql_from.js +3 -3
- package/build/src/abap/5_syntax/expressions/sql_in.js +34 -0
- package/build/src/abap/5_syntax/expressions/sql_order_by.js +2 -2
- package/build/src/abap/5_syntax/expressions/sql_source.js +3 -3
- package/build/src/abap/5_syntax/expressions/string_template.js +16 -8
- package/build/src/abap/5_syntax/expressions/switch_body.js +8 -4
- package/build/src/abap/5_syntax/expressions/table_expression.js +2 -2
- package/build/src/abap/5_syntax/expressions/target.js +50 -29
- package/build/src/abap/5_syntax/expressions/type_table.js +7 -7
- package/build/src/abap/5_syntax/expressions/value_body.js +17 -12
- package/build/src/abap/5_syntax/global_definitions/find_global_definitions.js +19 -6
- package/build/src/abap/5_syntax/spaghetti_scope.js +2 -1
- package/build/src/abap/5_syntax/statements/add.js +3 -3
- package/build/src/abap/5_syntax/statements/add_corresponding.js +3 -3
- package/build/src/abap/5_syntax/statements/append.js +25 -14
- package/build/src/abap/5_syntax/statements/assert.js +2 -2
- package/build/src/abap/5_syntax/statements/assign.js +17 -12
- package/build/src/abap/5_syntax/statements/authority_check.js +2 -2
- package/build/src/abap/5_syntax/statements/call.js +8 -5
- package/build/src/abap/5_syntax/statements/call_badi.js +4 -4
- package/build/src/abap/5_syntax/statements/call_function.js +12 -9
- package/build/src/abap/5_syntax/statements/call_kernel.js +2 -2
- package/build/src/abap/5_syntax/statements/call_transaction.js +3 -3
- package/build/src/abap/5_syntax/statements/call_transformation.js +5 -5
- package/build/src/abap/5_syntax/statements/case.js +2 -2
- package/build/src/abap/5_syntax/statements/case_type.js +2 -2
- package/build/src/abap/5_syntax/statements/catch.js +24 -19
- package/build/src/abap/5_syntax/statements/check.js +2 -2
- package/build/src/abap/5_syntax/statements/class_data.js +9 -5
- package/build/src/abap/5_syntax/statements/class_deferred.js +2 -2
- package/build/src/abap/5_syntax/statements/class_implementation.js +16 -13
- package/build/src/abap/5_syntax/statements/class_local_friends.js +16 -9
- package/build/src/abap/5_syntax/statements/clear.js +3 -3
- package/build/src/abap/5_syntax/statements/close_dataset.js +2 -2
- package/build/src/abap/5_syntax/statements/collect.js +4 -4
- package/build/src/abap/5_syntax/statements/commit_entities.js +4 -4
- package/build/src/abap/5_syntax/statements/concatenate.js +18 -11
- package/build/src/abap/5_syntax/statements/condense.js +2 -2
- package/build/src/abap/5_syntax/statements/constant.js +6 -5
- package/build/src/abap/5_syntax/statements/controls.js +5 -5
- package/build/src/abap/5_syntax/statements/convert.js +8 -8
- package/build/src/abap/5_syntax/statements/create_data.js +11 -11
- package/build/src/abap/5_syntax/statements/create_object.js +49 -26
- package/build/src/abap/5_syntax/statements/data.js +8 -4
- package/build/src/abap/5_syntax/statements/delete_cluster.js +4 -4
- package/build/src/abap/5_syntax/statements/delete_database.js +5 -5
- package/build/src/abap/5_syntax/statements/delete_internal.js +7 -7
- package/build/src/abap/5_syntax/statements/delete_report.js +2 -2
- package/build/src/abap/5_syntax/statements/describe.js +13 -13
- package/build/src/abap/5_syntax/statements/divide.js +3 -3
- package/build/src/abap/5_syntax/statements/do.js +8 -5
- package/build/src/abap/5_syntax/statements/editor_call.js +3 -3
- package/build/src/abap/5_syntax/statements/else_if.js +2 -2
- package/build/src/abap/5_syntax/statements/export.js +5 -5
- package/build/src/abap/5_syntax/statements/fieldsymbol.js +4 -4
- package/build/src/abap/5_syntax/statements/find.js +13 -13
- package/build/src/abap/5_syntax/statements/form.js +10 -7
- package/build/src/abap/5_syntax/statements/format.js +2 -2
- package/build/src/abap/5_syntax/statements/get_badi.js +4 -4
- package/build/src/abap/5_syntax/statements/get_bit.js +9 -6
- package/build/src/abap/5_syntax/statements/get_cursor.js +2 -2
- package/build/src/abap/5_syntax/statements/get_locale.js +3 -3
- package/build/src/abap/5_syntax/statements/get_parameter.js +4 -4
- package/build/src/abap/5_syntax/statements/get_reference.js +8 -5
- package/build/src/abap/5_syntax/statements/get_run_time.js +3 -3
- package/build/src/abap/5_syntax/statements/get_time.js +3 -3
- package/build/src/abap/5_syntax/statements/if.js +2 -2
- package/build/src/abap/5_syntax/statements/import.js +5 -5
- package/build/src/abap/5_syntax/statements/import_dynpro.js +3 -3
- package/build/src/abap/5_syntax/statements/include_type.js +9 -5
- package/build/src/abap/5_syntax/statements/insert_database.js +5 -5
- package/build/src/abap/5_syntax/statements/insert_field_group.js +4 -4
- package/build/src/abap/5_syntax/statements/insert_internal.js +22 -13
- package/build/src/abap/5_syntax/statements/insert_report.js +2 -2
- package/build/src/abap/5_syntax/statements/insert_textpool.js +2 -2
- package/build/src/abap/5_syntax/statements/interface_deferred.js +2 -2
- package/build/src/abap/5_syntax/statements/log_point.js +2 -2
- package/build/src/abap/5_syntax/statements/loop.js +29 -16
- package/build/src/abap/5_syntax/statements/loop_at_screen.js +3 -3
- package/build/src/abap/5_syntax/statements/message.js +6 -6
- package/build/src/abap/5_syntax/statements/method_implementation.js +18 -13
- package/build/src/abap/5_syntax/statements/modify_database.js +8 -8
- package/build/src/abap/5_syntax/statements/modify_entities.js +4 -4
- package/build/src/abap/5_syntax/statements/modify_internal.js +15 -8
- package/build/src/abap/5_syntax/statements/modify_screen.js +2 -2
- package/build/src/abap/5_syntax/statements/move.js +17 -10
- package/build/src/abap/5_syntax/statements/move_corresponding.js +14 -7
- package/build/src/abap/5_syntax/statements/multiply.js +3 -3
- package/build/src/abap/5_syntax/statements/open_dataset.js +3 -3
- package/build/src/abap/5_syntax/statements/pack.js +3 -3
- package/build/src/abap/5_syntax/statements/parameter.js +11 -6
- package/build/src/abap/5_syntax/statements/perform.js +12 -8
- package/build/src/abap/5_syntax/statements/raise.js +23 -18
- package/build/src/abap/5_syntax/statements/raise_event.js +4 -4
- package/build/src/abap/5_syntax/statements/ranges.js +6 -5
- package/build/src/abap/5_syntax/statements/read_entities.js +4 -4
- package/build/src/abap/5_syntax/statements/read_report.js +3 -3
- package/build/src/abap/5_syntax/statements/read_table.js +40 -21
- package/build/src/abap/5_syntax/statements/read_textpool.js +3 -3
- package/build/src/abap/5_syntax/statements/receive.js +3 -3
- package/build/src/abap/5_syntax/statements/replace.js +3 -3
- package/build/src/abap/5_syntax/statements/scan.js +3 -3
- package/build/src/abap/5_syntax/statements/search.js +2 -2
- package/build/src/abap/5_syntax/statements/select.js +2 -2
- package/build/src/abap/5_syntax/statements/select_loop.js +2 -2
- package/build/src/abap/5_syntax/statements/selection_screen.js +4 -4
- package/build/src/abap/5_syntax/statements/selectoption.js +9 -6
- package/build/src/abap/5_syntax/statements/set_bit.js +8 -5
- package/build/src/abap/5_syntax/statements/set_handler.js +3 -3
- package/build/src/abap/5_syntax/statements/set_locale.js +3 -3
- package/build/src/abap/5_syntax/statements/set_parameter.js +2 -2
- package/build/src/abap/5_syntax/statements/set_pf_status.js +2 -2
- package/build/src/abap/5_syntax/statements/set_titlebar.js +2 -2
- package/build/src/abap/5_syntax/statements/shift.js +15 -8
- package/build/src/abap/5_syntax/statements/sort.js +16 -7
- package/build/src/abap/5_syntax/statements/split.js +12 -7
- package/build/src/abap/5_syntax/statements/static.js +4 -4
- package/build/src/abap/5_syntax/statements/submit.js +4 -4
- package/build/src/abap/5_syntax/statements/subtract.js +3 -3
- package/build/src/abap/5_syntax/statements/subtract_corresponding.js +3 -3
- package/build/src/abap/5_syntax/statements/syntax_check.js +3 -3
- package/build/src/abap/5_syntax/statements/system_call.js +2 -2
- package/build/src/abap/5_syntax/statements/tables.js +7 -7
- package/build/src/abap/5_syntax/statements/transfer.js +3 -3
- package/build/src/abap/5_syntax/statements/translate.js +3 -3
- package/build/src/abap/5_syntax/statements/truncate_dataset.js +2 -2
- package/build/src/abap/5_syntax/statements/type.js +12 -7
- package/build/src/abap/5_syntax/statements/unassign.js +7 -4
- package/build/src/abap/5_syntax/statements/unpack.js +3 -3
- package/build/src/abap/5_syntax/statements/update_database.js +11 -11
- package/build/src/abap/5_syntax/statements/wait.js +3 -3
- package/build/src/abap/5_syntax/statements/when.js +2 -2
- package/build/src/abap/5_syntax/statements/when_type.js +9 -6
- package/build/src/abap/5_syntax/statements/while.js +4 -4
- package/build/src/abap/5_syntax/statements/with.js +3 -3
- package/build/src/abap/5_syntax/statements/with_loop.js +3 -3
- package/build/src/abap/5_syntax/statements/write.js +14 -10
- package/build/src/abap/5_syntax/structures/class_data.js +3 -3
- package/build/src/abap/5_syntax/structures/constants.js +6 -5
- package/build/src/abap/5_syntax/structures/data.js +17 -13
- package/build/src/abap/5_syntax/structures/statics.js +16 -11
- package/build/src/abap/5_syntax/structures/type_enum.js +15 -13
- package/build/src/abap/5_syntax/structures/types.js +9 -9
- package/build/src/abap/5_syntax/syntax.js +32 -16
- package/build/src/abap/types/class_attributes.js +30 -30
- package/build/src/abap/types/class_definition.js +29 -29
- package/build/src/abap/types/event_definition.js +5 -5
- package/build/src/abap/types/form_definition.js +13 -13
- package/build/src/abap/types/interface_definition.js +23 -22
- package/build/src/abap/types/method_definition.js +10 -10
- package/build/src/abap/types/method_definitions.js +9 -10
- package/build/src/abap/types/method_parameters.js +29 -29
- package/build/src/issue.js +12 -0
- package/build/src/registry.js +1 -1
- package/build/src/rules/check_syntax.js +2 -1
- package/build/src/rules/double_space.js +6 -3
- package/package.json +3 -3
|
@@ -10,86 +10,103 @@ const basic_1 = require("../../types/basic");
|
|
|
10
10
|
const types_1 = require("../../types");
|
|
11
11
|
const _object_oriented_1 = require("../_object_oriented");
|
|
12
12
|
const _type_utils_1 = require("../_type_utils");
|
|
13
|
+
const _syntax_input_1 = require("../_syntax_input");
|
|
13
14
|
class CreateObject {
|
|
14
|
-
runSyntax(node,
|
|
15
|
+
runSyntax(node, input) {
|
|
15
16
|
let cdef = undefined;
|
|
16
17
|
// CREATE OBJECT, TYPE
|
|
17
18
|
const type = node.findExpressionAfterToken("TYPE");
|
|
18
19
|
if (type && type.get() instanceof Expressions.ClassName) {
|
|
19
20
|
const token = type.getFirstToken();
|
|
20
21
|
const name = token.getStr();
|
|
21
|
-
cdef = scope.findClassDefinition(name);
|
|
22
|
+
cdef = input.scope.findClassDefinition(name);
|
|
22
23
|
if (cdef) {
|
|
23
|
-
scope.addReference(token, cdef, _reference_1.ReferenceType.ObjectOrientedReference, filename);
|
|
24
|
+
input.scope.addReference(token, cdef, _reference_1.ReferenceType.ObjectOrientedReference, input.filename);
|
|
24
25
|
if (cdef.isAbstract() === true) {
|
|
25
|
-
|
|
26
|
+
const message = cdef.getName() + " is abstract, cannot be instantiated";
|
|
27
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
28
|
+
return;
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
|
-
else if (scope.getDDIC().inErrorNamespace(name) === false) {
|
|
29
|
-
scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: name, ooType: "CLAS" });
|
|
31
|
+
else if (input.scope.getDDIC().inErrorNamespace(name) === false) {
|
|
32
|
+
input.scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, input.filename, { ooName: name, ooType: "CLAS" });
|
|
30
33
|
}
|
|
31
34
|
else {
|
|
32
|
-
|
|
35
|
+
const message = "TYPE \"" + name + "\" not found";
|
|
36
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
37
|
+
return;
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
40
|
// just recurse
|
|
36
41
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
37
|
-
new source_1.Source().runSyntax(s,
|
|
42
|
+
new source_1.Source().runSyntax(s, input);
|
|
38
43
|
}
|
|
39
44
|
let first = true;
|
|
40
45
|
for (const t of node.findAllExpressions(Expressions.Target)) {
|
|
41
|
-
const found = new target_1.Target().runSyntax(t,
|
|
46
|
+
const found = new target_1.Target().runSyntax(t, input);
|
|
42
47
|
if (first === true) {
|
|
43
48
|
first = false;
|
|
44
49
|
if (found instanceof basic_1.VoidType) {
|
|
45
50
|
continue;
|
|
46
51
|
}
|
|
47
52
|
else if (found instanceof basic_1.UnknownType) {
|
|
48
|
-
|
|
53
|
+
const message = "Target type unknown, " + t.concatTokens();
|
|
54
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
55
|
+
return;
|
|
49
56
|
}
|
|
50
57
|
else if (!(found instanceof basic_1.ObjectReferenceType)
|
|
51
58
|
&& !(found instanceof basic_1.AnyType)
|
|
52
59
|
&& !(found instanceof basic_1.DataType)
|
|
53
60
|
&& !(found instanceof basic_1.GenericObjectReferenceType)) {
|
|
54
|
-
|
|
61
|
+
const message = "Target must be an object reference, " + t.concatTokens();
|
|
62
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
63
|
+
return;
|
|
55
64
|
}
|
|
56
65
|
else if (found instanceof basic_1.GenericObjectReferenceType && type === undefined) {
|
|
57
|
-
|
|
66
|
+
const message = "Generic type, cannot be instantiated";
|
|
67
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
68
|
+
return;
|
|
58
69
|
}
|
|
59
70
|
else if (found instanceof basic_1.ObjectReferenceType) {
|
|
60
71
|
const id = found.getIdentifier();
|
|
61
72
|
if (id instanceof types_1.InterfaceDefinition && type === undefined) {
|
|
62
|
-
|
|
73
|
+
const message = "Interface reference, cannot be instantiated";
|
|
74
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
75
|
+
return;
|
|
63
76
|
}
|
|
64
77
|
else if (found instanceof basic_1.ObjectReferenceType
|
|
65
78
|
&& type === undefined
|
|
66
|
-
&& scope.findInterfaceDefinition(found.getQualifiedName())) {
|
|
67
|
-
|
|
79
|
+
&& input.scope.findInterfaceDefinition(found.getQualifiedName())) {
|
|
80
|
+
const message = "Interface reference, cannot be instantiated";
|
|
81
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
82
|
+
return;
|
|
68
83
|
}
|
|
69
84
|
else if (id instanceof types_1.ClassDefinition && cdef === undefined) {
|
|
70
85
|
cdef = id;
|
|
71
86
|
}
|
|
72
87
|
if (type === undefined && id instanceof types_1.ClassDefinition && id.isAbstract() === true) {
|
|
73
|
-
|
|
88
|
+
const message = id.getName() + " is abstract, cannot be instantiated";
|
|
89
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
90
|
+
return;
|
|
74
91
|
}
|
|
75
92
|
}
|
|
76
93
|
}
|
|
77
94
|
}
|
|
78
95
|
for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
79
|
-
new dynamic_1.Dynamic().runSyntax(t,
|
|
96
|
+
new dynamic_1.Dynamic().runSyntax(t, input);
|
|
80
97
|
}
|
|
81
|
-
this.validateParameters(cdef, node,
|
|
98
|
+
this.validateParameters(cdef, node, input);
|
|
82
99
|
}
|
|
83
|
-
validateParameters(cdef, node,
|
|
100
|
+
validateParameters(cdef, node, input) {
|
|
84
101
|
var _a, _b, _c, _d;
|
|
85
102
|
if (cdef === undefined) {
|
|
86
103
|
const sources = (_a = node.findDirectExpression(Expressions.ParameterListS)) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Source);
|
|
87
104
|
for (const s of sources || []) {
|
|
88
|
-
new source_1.Source().runSyntax(s,
|
|
105
|
+
new source_1.Source().runSyntax(s, input);
|
|
89
106
|
}
|
|
90
107
|
return;
|
|
91
108
|
}
|
|
92
|
-
const methodDef = new _object_oriented_1.ObjectOriented(scope).searchMethodName(cdef, "CONSTRUCTOR");
|
|
109
|
+
const methodDef = new _object_oriented_1.ObjectOriented(input.scope).searchMethodName(cdef, "CONSTRUCTOR");
|
|
93
110
|
const methodParameters = (_b = methodDef.method) === null || _b === void 0 ? void 0 : _b.getParameters();
|
|
94
111
|
const allImporting = (methodParameters === null || methodParameters === void 0 ? void 0 : methodParameters.getImporting()) || [];
|
|
95
112
|
const requiredImporting = new Set(methodParameters === null || methodParameters === void 0 ? void 0 : methodParameters.getRequiredParameters().map(i => i.getName().toUpperCase()));
|
|
@@ -99,21 +116,27 @@ class CreateObject {
|
|
|
99
116
|
continue;
|
|
100
117
|
}
|
|
101
118
|
const source = p.findDirectExpression(Expressions.Source);
|
|
102
|
-
const sourceType = new source_1.Source().runSyntax(source,
|
|
119
|
+
const sourceType = new source_1.Source().runSyntax(source, input);
|
|
103
120
|
const calculated = (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.MethodCallChain)) !== undefined
|
|
104
121
|
|| (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.StringTemplate)) !== undefined
|
|
105
122
|
|| (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.ArithOperator)) !== undefined;
|
|
106
123
|
const found = allImporting === null || allImporting === void 0 ? void 0 : allImporting.find(p => p.getName().toUpperCase() === name);
|
|
107
124
|
if (found === undefined) {
|
|
108
|
-
|
|
125
|
+
const message = `constructor parameter "${name}" does not exist`;
|
|
126
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
127
|
+
return;
|
|
109
128
|
}
|
|
110
|
-
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, found.getType(), calculated) === false) {
|
|
111
|
-
|
|
129
|
+
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(sourceType, found.getType(), calculated) === false) {
|
|
130
|
+
const message = `constructor parameter "${name}" type not compatible`;
|
|
131
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
132
|
+
return;
|
|
112
133
|
}
|
|
113
134
|
requiredImporting.delete(name);
|
|
114
135
|
}
|
|
115
136
|
for (const r of requiredImporting.values()) {
|
|
116
|
-
|
|
137
|
+
const message = `constructor parameter "${r}" must be supplied`;
|
|
138
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
139
|
+
return;
|
|
117
140
|
}
|
|
118
141
|
}
|
|
119
142
|
}
|
|
@@ -5,20 +5,24 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const _typed_identifier_1 = require("../../types/_typed_identifier");
|
|
6
6
|
const data_definition_1 = require("../expressions/data_definition");
|
|
7
7
|
const unknown_type_1 = require("../../types/basic/unknown_type");
|
|
8
|
+
const _syntax_input_1 = require("../_syntax_input");
|
|
9
|
+
const basic_1 = require("../../types/basic");
|
|
8
10
|
class Data {
|
|
9
|
-
runSyntax(node,
|
|
11
|
+
runSyntax(node, input) {
|
|
10
12
|
const name = node.findFirstExpression(Expressions.DefinitionName);
|
|
11
13
|
const dd = node.findFirstExpression(Expressions.DataDefinition);
|
|
12
14
|
if (dd) {
|
|
13
|
-
const id = new data_definition_1.DataDefinition().runSyntax(dd,
|
|
15
|
+
const id = new data_definition_1.DataDefinition().runSyntax(dd, input);
|
|
14
16
|
if ((id === null || id === void 0 ? void 0 : id.getType().isGeneric()) === true
|
|
15
17
|
&& (id === null || id === void 0 ? void 0 : id.getType().containsVoid()) === false) {
|
|
16
|
-
|
|
18
|
+
const message = "DATA definition cannot be generic, " + (name === null || name === void 0 ? void 0 : name.concatTokens());
|
|
19
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
20
|
+
return new _typed_identifier_1.TypedIdentifier(id.getToken(), input.filename, new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey));
|
|
17
21
|
}
|
|
18
22
|
return id;
|
|
19
23
|
}
|
|
20
24
|
if (name) {
|
|
21
|
-
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new unknown_type_1.UnknownType("data, fallback"));
|
|
25
|
+
return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), input.filename, new unknown_type_1.UnknownType("data, fallback"));
|
|
22
26
|
}
|
|
23
27
|
return undefined;
|
|
24
28
|
}
|
|
@@ -4,16 +4,16 @@ exports.DeleteCluster = void 0;
|
|
|
4
4
|
const Expressions = require("../../2_statements/expressions");
|
|
5
5
|
const source_1 = require("../expressions/source");
|
|
6
6
|
class DeleteCluster {
|
|
7
|
-
runSyntax(node,
|
|
7
|
+
runSyntax(node, input) {
|
|
8
8
|
var _a;
|
|
9
9
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
10
|
-
new source_1.Source().runSyntax(s,
|
|
10
|
+
new source_1.Source().runSyntax(s, input);
|
|
11
11
|
}
|
|
12
12
|
const databaseName = node.findExpressionAfterToken("DATABASE");
|
|
13
13
|
if (databaseName) {
|
|
14
|
-
const found = (_a = scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.lookupTableOrView(databaseName.concatTokens());
|
|
14
|
+
const found = (_a = input.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.lookupTableOrView(databaseName.concatTokens());
|
|
15
15
|
if (found) {
|
|
16
|
-
scope.getDDICReferences().addUsing(scope.getParentObj(), { object: found.object });
|
|
16
|
+
input.scope.getDDICReferences().addUsing(input.scope.getParentObj(), { object: found.object });
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -6,19 +6,19 @@ const source_1 = require("../expressions/source");
|
|
|
6
6
|
const dynamic_1 = require("../expressions/dynamic");
|
|
7
7
|
const database_table_1 = require("../expressions/database_table");
|
|
8
8
|
class DeleteDatabase {
|
|
9
|
-
runSyntax(node,
|
|
9
|
+
runSyntax(node, input) {
|
|
10
10
|
for (const s of node.findAllExpressions(Expressions.Source)) {
|
|
11
|
-
new source_1.Source().runSyntax(s,
|
|
11
|
+
new source_1.Source().runSyntax(s, input);
|
|
12
12
|
}
|
|
13
13
|
for (const s of node.findAllExpressions(Expressions.SimpleSource3)) {
|
|
14
|
-
new source_1.Source().runSyntax(s,
|
|
14
|
+
new source_1.Source().runSyntax(s, input);
|
|
15
15
|
}
|
|
16
16
|
for (const d of node.findAllExpressions(Expressions.Dynamic)) {
|
|
17
|
-
new dynamic_1.Dynamic().runSyntax(d,
|
|
17
|
+
new dynamic_1.Dynamic().runSyntax(d, input);
|
|
18
18
|
}
|
|
19
19
|
const dbtab = node.findFirstExpression(Expressions.DatabaseTable);
|
|
20
20
|
if (dbtab !== undefined) {
|
|
21
|
-
new database_table_1.DatabaseTable().runSyntax(dbtab,
|
|
21
|
+
new database_table_1.DatabaseTable().runSyntax(dbtab, input);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -8,10 +8,10 @@ const component_compare_1 = require("../expressions/component_compare");
|
|
|
8
8
|
const component_cond_1 = require("../expressions/component_cond");
|
|
9
9
|
const basic_1 = require("../../types/basic");
|
|
10
10
|
class DeleteInternal {
|
|
11
|
-
runSyntax(node,
|
|
11
|
+
runSyntax(node, input) {
|
|
12
12
|
var _a;
|
|
13
13
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
14
|
-
new source_1.Source().runSyntax(s,
|
|
14
|
+
new source_1.Source().runSyntax(s, input);
|
|
15
15
|
}
|
|
16
16
|
let targetType = undefined;
|
|
17
17
|
const target = node.findDirectExpression(Expressions.Target);
|
|
@@ -19,23 +19,23 @@ class DeleteInternal {
|
|
|
19
19
|
let tabl = undefined;
|
|
20
20
|
if (node.getChildren().length === 5 && node.getChildren()[2].concatTokens().toUpperCase() === "FROM") {
|
|
21
21
|
// it might be a database table
|
|
22
|
-
tabl = (_a = scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.lookupTableOrView(target.concatTokens());
|
|
22
|
+
tabl = (_a = input.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.lookupTableOrView(target.concatTokens());
|
|
23
23
|
if (tabl) {
|
|
24
|
-
scope.getDDICReferences().addUsing(scope.getParentObj(), { object: tabl.object });
|
|
24
|
+
input.scope.getDDICReferences().addUsing(input.scope.getParentObj(), { object: tabl.object });
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
if (tabl === undefined) {
|
|
28
|
-
targetType = new target_1.Target().runSyntax(target,
|
|
28
|
+
targetType = new target_1.Target().runSyntax(target, input);
|
|
29
29
|
if (targetType instanceof basic_1.TableType) {
|
|
30
30
|
targetType = targetType.getRowType();
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) {
|
|
35
|
-
new component_compare_1.ComponentCompare().runSyntax(t,
|
|
35
|
+
new component_compare_1.ComponentCompare().runSyntax(t, input, targetType);
|
|
36
36
|
}
|
|
37
37
|
for (const t of node.findDirectExpressions(Expressions.ComponentCond)) {
|
|
38
|
-
new component_cond_1.ComponentCond().runSyntax(t,
|
|
38
|
+
new component_cond_1.ComponentCond().runSyntax(t, input, targetType);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -4,9 +4,9 @@ exports.DeleteReport = void 0;
|
|
|
4
4
|
const Expressions = require("../../2_statements/expressions");
|
|
5
5
|
const source_1 = require("../expressions/source");
|
|
6
6
|
class DeleteReport {
|
|
7
|
-
runSyntax(node,
|
|
7
|
+
runSyntax(node, input) {
|
|
8
8
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
9
|
-
new source_1.Source().runSyntax(s,
|
|
9
|
+
new source_1.Source().runSyntax(s, input);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -9,51 +9,51 @@ const source_1 = require("../expressions/source");
|
|
|
9
9
|
const field_chain_1 = require("../expressions/field_chain");
|
|
10
10
|
const _reference_1 = require("../_reference");
|
|
11
11
|
class Describe {
|
|
12
|
-
runSyntax(node,
|
|
13
|
-
for (const s of node.
|
|
14
|
-
new source_1.Source().runSyntax(s,
|
|
12
|
+
runSyntax(node, input) {
|
|
13
|
+
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
14
|
+
new source_1.Source().runSyntax(s, input);
|
|
15
15
|
}
|
|
16
|
-
for (const s of node.
|
|
17
|
-
new field_chain_1.FieldChain().runSyntax(s,
|
|
16
|
+
for (const s of node.findDirectExpressions(Expressions.FieldChain)) {
|
|
17
|
+
new field_chain_1.FieldChain().runSyntax(s, input, _reference_1.ReferenceType.DataReadReference);
|
|
18
18
|
}
|
|
19
19
|
const linesTarget = node.findExpressionAfterToken("LINES");
|
|
20
20
|
if ((linesTarget === null || linesTarget === void 0 ? void 0 : linesTarget.get()) instanceof Expressions.Target) {
|
|
21
21
|
const inline = linesTarget === null || linesTarget === void 0 ? void 0 : linesTarget.findDirectExpression(Expressions.InlineData);
|
|
22
22
|
if (inline) {
|
|
23
|
-
new inline_data_1.InlineData().runSyntax(inline,
|
|
23
|
+
new inline_data_1.InlineData().runSyntax(inline, input, basic_1.IntegerType.get());
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
|
-
new target_1.Target().runSyntax(linesTarget,
|
|
26
|
+
new target_1.Target().runSyntax(linesTarget, input);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
const typeTarget = node.findExpressionAfterToken("TYPE");
|
|
30
30
|
if ((typeTarget === null || typeTarget === void 0 ? void 0 : typeTarget.get()) instanceof Expressions.Target) {
|
|
31
31
|
const inline = typeTarget === null || typeTarget === void 0 ? void 0 : typeTarget.findDirectExpression(Expressions.InlineData);
|
|
32
32
|
if (inline) {
|
|
33
|
-
new inline_data_1.InlineData().runSyntax(inline,
|
|
33
|
+
new inline_data_1.InlineData().runSyntax(inline, input, new basic_1.CharacterType(1));
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
new target_1.Target().runSyntax(typeTarget,
|
|
36
|
+
new target_1.Target().runSyntax(typeTarget, input);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
const lengthTarget = node.findExpressionAfterToken("LENGTH");
|
|
40
40
|
if ((lengthTarget === null || lengthTarget === void 0 ? void 0 : lengthTarget.get()) instanceof Expressions.Target) {
|
|
41
41
|
const inline = lengthTarget === null || lengthTarget === void 0 ? void 0 : lengthTarget.findDirectExpression(Expressions.InlineData);
|
|
42
42
|
if (inline) {
|
|
43
|
-
new inline_data_1.InlineData().runSyntax(inline,
|
|
43
|
+
new inline_data_1.InlineData().runSyntax(inline, input, basic_1.IntegerType.get());
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
new target_1.Target().runSyntax(lengthTarget,
|
|
46
|
+
new target_1.Target().runSyntax(lengthTarget, input);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
const componentsTarget = node.findExpressionAfterToken("COMPONENTS");
|
|
50
50
|
if ((componentsTarget === null || componentsTarget === void 0 ? void 0 : componentsTarget.get()) instanceof Expressions.Target) {
|
|
51
51
|
const inline = componentsTarget === null || componentsTarget === void 0 ? void 0 : componentsTarget.findDirectExpression(Expressions.InlineData);
|
|
52
52
|
if (inline) {
|
|
53
|
-
new inline_data_1.InlineData().runSyntax(inline,
|
|
53
|
+
new inline_data_1.InlineData().runSyntax(inline, input, basic_1.IntegerType.get());
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
new target_1.Target().runSyntax(componentsTarget,
|
|
56
|
+
new target_1.Target().runSyntax(componentsTarget, input);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -5,12 +5,12 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const source_1 = require("../expressions/source");
|
|
6
6
|
const target_1 = require("../expressions/target");
|
|
7
7
|
class Divide {
|
|
8
|
-
runSyntax(node,
|
|
8
|
+
runSyntax(node, input) {
|
|
9
9
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
10
|
-
new source_1.Source().runSyntax(s,
|
|
10
|
+
new source_1.Source().runSyntax(s, input);
|
|
11
11
|
}
|
|
12
12
|
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
13
|
-
new target_1.Target().runSyntax(t,
|
|
13
|
+
new target_1.Target().runSyntax(t, input);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -6,18 +6,21 @@ const source_1 = require("../expressions/source");
|
|
|
6
6
|
const target_1 = require("../expressions/target");
|
|
7
7
|
const _type_utils_1 = require("../_type_utils");
|
|
8
8
|
const basic_1 = require("../../types/basic");
|
|
9
|
+
const _syntax_input_1 = require("../_syntax_input");
|
|
9
10
|
class Do {
|
|
10
|
-
runSyntax(node,
|
|
11
|
+
runSyntax(node, input) {
|
|
11
12
|
const afterDo = node.findExpressionAfterToken("DO");
|
|
12
13
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
13
|
-
const type = new source_1.Source().runSyntax(s,
|
|
14
|
+
const type = new source_1.Source().runSyntax(s, input);
|
|
14
15
|
if (s === afterDo
|
|
15
|
-
&& new _type_utils_1.TypeUtils(scope).isAssignable(type, basic_1.IntegerType.get()) === false) {
|
|
16
|
-
|
|
16
|
+
&& new _type_utils_1.TypeUtils(input.scope).isAssignable(type, basic_1.IntegerType.get()) === false) {
|
|
17
|
+
const message = "DO TIMES must be numeric";
|
|
18
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
19
|
+
return;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
20
|
-
new target_1.Target().runSyntax(t,
|
|
23
|
+
new target_1.Target().runSyntax(t, input);
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
}
|
|
@@ -4,12 +4,12 @@ exports.EditorCall = void 0;
|
|
|
4
4
|
const Expressions = require("../../2_statements/expressions");
|
|
5
5
|
const source_1 = require("../expressions/source");
|
|
6
6
|
class EditorCall {
|
|
7
|
-
runSyntax(node,
|
|
7
|
+
runSyntax(node, input) {
|
|
8
8
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
9
|
-
new source_1.Source().runSyntax(s,
|
|
9
|
+
new source_1.Source().runSyntax(s, input);
|
|
10
10
|
}
|
|
11
11
|
for (const t of node.findDirectExpressions(Expressions.SimpleSource3)) {
|
|
12
|
-
new source_1.Source().runSyntax(t,
|
|
12
|
+
new source_1.Source().runSyntax(t, input);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -4,9 +4,9 @@ exports.ElseIf = void 0;
|
|
|
4
4
|
const Expressions = require("../../2_statements/expressions");
|
|
5
5
|
const cond_1 = require("../expressions/cond");
|
|
6
6
|
class ElseIf {
|
|
7
|
-
runSyntax(node,
|
|
7
|
+
runSyntax(node, input) {
|
|
8
8
|
for (const s of node.findDirectExpressions(Expressions.Cond)) {
|
|
9
|
-
new cond_1.Cond().runSyntax(s,
|
|
9
|
+
new cond_1.Cond().runSyntax(s, input);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -5,19 +5,19 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const source_1 = require("../expressions/source");
|
|
6
6
|
const target_1 = require("../expressions/target");
|
|
7
7
|
class Export {
|
|
8
|
-
runSyntax(node,
|
|
8
|
+
runSyntax(node, input) {
|
|
9
9
|
var _a;
|
|
10
10
|
for (const s of node.findAllExpressions(Expressions.Source)) {
|
|
11
|
-
new source_1.Source().runSyntax(s,
|
|
11
|
+
new source_1.Source().runSyntax(s, input);
|
|
12
12
|
}
|
|
13
13
|
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
14
|
-
new target_1.Target().runSyntax(t,
|
|
14
|
+
new target_1.Target().runSyntax(t, input);
|
|
15
15
|
}
|
|
16
16
|
const databaseName = node.findExpressionAfterToken("DATABASE");
|
|
17
17
|
if (databaseName) {
|
|
18
|
-
const found = (_a = scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.lookupTableOrView(databaseName.concatTokens());
|
|
18
|
+
const found = (_a = input.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.lookupTableOrView(databaseName.concatTokens());
|
|
19
19
|
if (found) {
|
|
20
|
-
scope.getDDICReferences().addUsing(scope.getParentObj(), { object: found.object });
|
|
20
|
+
input.scope.getDDICReferences().addUsing(input.scope.getParentObj(), { object: found.object });
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -6,16 +6,16 @@ const _typed_identifier_1 = require("../../types/_typed_identifier");
|
|
|
6
6
|
const basic_types_1 = require("../basic_types");
|
|
7
7
|
const unknown_type_1 = require("../../types/basic/unknown_type");
|
|
8
8
|
class FieldSymbol {
|
|
9
|
-
runSyntax(node,
|
|
9
|
+
runSyntax(node, input) {
|
|
10
10
|
var _a;
|
|
11
11
|
const fsname = (_a = node.findFirstExpression(Expressions.FieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
12
|
-
const bfound = new basic_types_1.BasicTypes(
|
|
12
|
+
const bfound = new basic_types_1.BasicTypes(input).parseType(node);
|
|
13
13
|
if (bfound && fsname) {
|
|
14
|
-
scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, filename, bfound));
|
|
14
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, bfound));
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
if (fsname) {
|
|
18
|
-
scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, filename, new unknown_type_1.UnknownType("Fieldsymbol, fallback")));
|
|
18
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, new unknown_type_1.UnknownType("Fieldsymbol, fallback")));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -7,9 +7,9 @@ const basic_1 = require("../../types/basic");
|
|
|
7
7
|
const source_1 = require("../expressions/source");
|
|
8
8
|
const target_1 = require("../expressions/target");
|
|
9
9
|
class Find {
|
|
10
|
-
runSyntax(node,
|
|
10
|
+
runSyntax(node, input) {
|
|
11
11
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
12
|
-
new source_1.Source().runSyntax(s,
|
|
12
|
+
new source_1.Source().runSyntax(s, input);
|
|
13
13
|
}
|
|
14
14
|
const rfound = node.findExpressionAfterToken("RESULTS");
|
|
15
15
|
if (rfound && rfound.get() instanceof Expressions.Target) {
|
|
@@ -24,29 +24,29 @@ class Find {
|
|
|
24
24
|
{ name: "SUBMATCHES", type: new basic_1.TableType(sub, { withHeader: false, keyType: basic_1.TableKeyType.default }) },
|
|
25
25
|
], "MATCH_RESULT", "MATCH_RESULT");
|
|
26
26
|
if (node.concatTokens().toUpperCase().startsWith("FIND FIRST")) {
|
|
27
|
-
this.inline(rfound,
|
|
27
|
+
this.inline(rfound, input, type);
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
this.inline(rfound,
|
|
30
|
+
this.inline(rfound, input, new basic_1.TableType(type, { withHeader: false, keyType: basic_1.TableKeyType.default }, "MATCH_RESULT_TAB"));
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
const ofound = node.findExpressionsAfterToken("OFFSET");
|
|
34
34
|
for (const o of ofound) {
|
|
35
35
|
if (o.get() instanceof Expressions.Target) {
|
|
36
|
-
this.inline(o,
|
|
36
|
+
this.inline(o, input, basic_1.IntegerType.get());
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
const lfound = node.findExpressionAfterToken("LINE");
|
|
40
40
|
if (lfound && lfound.get() instanceof Expressions.Target) {
|
|
41
|
-
this.inline(lfound,
|
|
41
|
+
this.inline(lfound, input, basic_1.IntegerType.get());
|
|
42
42
|
}
|
|
43
43
|
const cfound = node.findExpressionAfterToken("COUNT");
|
|
44
44
|
if (cfound && cfound.get() instanceof Expressions.Target) {
|
|
45
|
-
this.inline(cfound,
|
|
45
|
+
this.inline(cfound, input, basic_1.IntegerType.get());
|
|
46
46
|
}
|
|
47
47
|
const lnfound = node.findExpressionAfterToken("LENGTH");
|
|
48
48
|
if (lnfound && lnfound.get() instanceof Expressions.Target) {
|
|
49
|
-
this.inline(lnfound,
|
|
49
|
+
this.inline(lnfound, input, basic_1.IntegerType.get());
|
|
50
50
|
}
|
|
51
51
|
if (node.findDirectTokenByText("SUBMATCHES")) {
|
|
52
52
|
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
@@ -58,22 +58,22 @@ class Find {
|
|
|
58
58
|
}
|
|
59
59
|
const inline = t === null || t === void 0 ? void 0 : t.findDirectExpression(Expressions.InlineData);
|
|
60
60
|
if (inline) {
|
|
61
|
-
new inline_data_1.InlineData().runSyntax(inline,
|
|
61
|
+
new inline_data_1.InlineData().runSyntax(inline, input, basic_1.StringType.get());
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
|
-
new target_1.Target().runSyntax(t,
|
|
64
|
+
new target_1.Target().runSyntax(t, input);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
/////////////////////
|
|
70
|
-
inline(node,
|
|
70
|
+
inline(node, input, type) {
|
|
71
71
|
const inline = node.findDirectExpression(Expressions.InlineData);
|
|
72
72
|
if (inline) {
|
|
73
|
-
new inline_data_1.InlineData().runSyntax(inline,
|
|
73
|
+
new inline_data_1.InlineData().runSyntax(inline, input, type);
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
new target_1.Target().runSyntax(node,
|
|
76
|
+
new target_1.Target().runSyntax(node, input);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -4,18 +4,21 @@ exports.Form = void 0;
|
|
|
4
4
|
const form_definition_1 = require("../../types/form_definition");
|
|
5
5
|
const _scope_type_1 = require("../_scope_type");
|
|
6
6
|
const expressions_1 = require("../../2_statements/expressions");
|
|
7
|
+
const _syntax_input_1 = require("../_syntax_input");
|
|
7
8
|
class Form {
|
|
8
|
-
runSyntax(node,
|
|
9
|
+
runSyntax(node, input) {
|
|
9
10
|
var _a;
|
|
10
11
|
const name = (_a = node.findDirectExpression(expressions_1.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
11
12
|
if (name === undefined) {
|
|
12
|
-
|
|
13
|
+
const message = "Form, could not find name";
|
|
14
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
15
|
+
return;
|
|
13
16
|
}
|
|
14
|
-
scope.push(_scope_type_1.ScopeType.Form, name, node.getFirstToken().getStart(), filename);
|
|
15
|
-
const form = new form_definition_1.FormDefinition(node,
|
|
16
|
-
scope.addList(form.getUsingParameters());
|
|
17
|
-
scope.addList(form.getChangingParameters());
|
|
18
|
-
scope.addList(form.getTablesParameters());
|
|
17
|
+
input.scope.push(_scope_type_1.ScopeType.Form, name, node.getFirstToken().getStart(), input.filename);
|
|
18
|
+
const form = new form_definition_1.FormDefinition(node, input);
|
|
19
|
+
input.scope.addList(form.getUsingParameters());
|
|
20
|
+
input.scope.addList(form.getChangingParameters());
|
|
21
|
+
input.scope.addList(form.getTablesParameters());
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
exports.Form = Form;
|
|
@@ -4,9 +4,9 @@ exports.Format = void 0;
|
|
|
4
4
|
const Expressions = require("../../2_statements/expressions");
|
|
5
5
|
const source_1 = require("../expressions/source");
|
|
6
6
|
class Format {
|
|
7
|
-
runSyntax(node,
|
|
7
|
+
runSyntax(node, input) {
|
|
8
8
|
for (const s of node.findAllExpressions(Expressions.Source)) {
|
|
9
|
-
new source_1.Source().runSyntax(s,
|
|
9
|
+
new source_1.Source().runSyntax(s, input);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -6,15 +6,15 @@ const source_1 = require("../expressions/source");
|
|
|
6
6
|
const target_1 = require("../expressions/target");
|
|
7
7
|
const dynamic_1 = require("../expressions/dynamic");
|
|
8
8
|
class GetBadi {
|
|
9
|
-
runSyntax(node,
|
|
9
|
+
runSyntax(node, input) {
|
|
10
10
|
for (const s of node.findAllExpressions(Expressions.Source)) {
|
|
11
|
-
new source_1.Source().runSyntax(s,
|
|
11
|
+
new source_1.Source().runSyntax(s, input);
|
|
12
12
|
}
|
|
13
13
|
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
14
|
-
new target_1.Target().runSyntax(t,
|
|
14
|
+
new target_1.Target().runSyntax(t, input);
|
|
15
15
|
}
|
|
16
16
|
for (const d of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
17
|
-
new dynamic_1.Dynamic().runSyntax(d,
|
|
17
|
+
new dynamic_1.Dynamic().runSyntax(d, input);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|