@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
|
@@ -7,7 +7,7 @@ const events_1 = require("../2_statements/statements/events");
|
|
|
7
7
|
const expressions_1 = require("../2_statements/expressions");
|
|
8
8
|
const method_param_1 = require("../5_syntax/expressions/method_param");
|
|
9
9
|
class EventDefinition extends _identifier_1.Identifier {
|
|
10
|
-
constructor(node, _visibility,
|
|
10
|
+
constructor(node, _visibility, input) {
|
|
11
11
|
if (!(node.get() instanceof events_1.Events)) {
|
|
12
12
|
throw new Error("MethodDefinition, expected MethodDef as part of input node");
|
|
13
13
|
}
|
|
@@ -15,17 +15,17 @@ class EventDefinition extends _identifier_1.Identifier {
|
|
|
15
15
|
if (found === undefined) {
|
|
16
16
|
throw new Error("MethodDefinition, expected MethodDef as part of input node");
|
|
17
17
|
}
|
|
18
|
-
super(found.getFirstToken(), filename);
|
|
18
|
+
super(found.getFirstToken(), input.filename);
|
|
19
19
|
this.parameters = [];
|
|
20
|
-
this.parse(node,
|
|
20
|
+
this.parse(node, input);
|
|
21
21
|
}
|
|
22
22
|
getParameters() {
|
|
23
23
|
return this.parameters;
|
|
24
24
|
}
|
|
25
25
|
///////////////
|
|
26
|
-
parse(node,
|
|
26
|
+
parse(node, input) {
|
|
27
27
|
for (const e of node.findAllExpressions(expressions_1.MethodParam)) {
|
|
28
|
-
this.parameters.push(new method_param_1.MethodParam().runSyntax(e,
|
|
28
|
+
this.parameters.push(new method_param_1.MethodParam().runSyntax(e, input, []));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -10,18 +10,18 @@ const _typed_identifier_1 = require("./_typed_identifier");
|
|
|
10
10
|
const form_param_1 = require("../5_syntax/expressions/form_param");
|
|
11
11
|
const basic_1 = require("./basic");
|
|
12
12
|
class FormDefinition extends _identifier_1.Identifier {
|
|
13
|
-
constructor(node,
|
|
13
|
+
constructor(node, input) {
|
|
14
14
|
const st = node instanceof nodes_1.StructureNode ? node.findFirstStatement(Statements.Form) : node;
|
|
15
15
|
// FORMs can contain a dash in the name
|
|
16
16
|
const formName = st.findFirstExpression(Expressions.FormName);
|
|
17
17
|
const pos = formName.getFirstToken().getStart();
|
|
18
18
|
const name = formName.concatTokens();
|
|
19
19
|
const nameToken = new Tokens.Identifier(pos, name);
|
|
20
|
-
super(nameToken, filename);
|
|
20
|
+
super(nameToken, input.filename);
|
|
21
21
|
this.node = st;
|
|
22
|
-
this.tableParameters = this.findTables(
|
|
23
|
-
this.usingParameters = this.findType(Expressions.FormUsing,
|
|
24
|
-
this.changingParameters = this.findType(Expressions.FormChanging,
|
|
22
|
+
this.tableParameters = this.findTables(input);
|
|
23
|
+
this.usingParameters = this.findType(Expressions.FormUsing, input);
|
|
24
|
+
this.changingParameters = this.findType(Expressions.FormChanging, input);
|
|
25
25
|
}
|
|
26
26
|
getTablesParameters() {
|
|
27
27
|
return this.tableParameters;
|
|
@@ -33,7 +33,7 @@ class FormDefinition extends _identifier_1.Identifier {
|
|
|
33
33
|
return this.changingParameters;
|
|
34
34
|
}
|
|
35
35
|
///////////////
|
|
36
|
-
findTables(
|
|
36
|
+
findTables(input) {
|
|
37
37
|
const ret = [];
|
|
38
38
|
const tables = this.node.findFirstExpression(Expressions.FormTables);
|
|
39
39
|
if (tables === undefined) {
|
|
@@ -42,10 +42,10 @@ class FormDefinition extends _identifier_1.Identifier {
|
|
|
42
42
|
for (const param of tables.findAllExpressions(Expressions.FormParam)) {
|
|
43
43
|
if (param.getChildren().length === 1) {
|
|
44
44
|
// untyped TABLES parameter
|
|
45
|
-
ret.push(new _typed_identifier_1.TypedIdentifier(param.getFirstToken(), filename, new basic_1.VoidType("FORM:UNTYPED"), ["form_parameter" /* IdentifierMeta.FormParameter */]));
|
|
45
|
+
ret.push(new _typed_identifier_1.TypedIdentifier(param.getFirstToken(), input.filename, new basic_1.VoidType("FORM:UNTYPED"), ["form_parameter" /* IdentifierMeta.FormParameter */]));
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
|
-
const p = new form_param_1.FormParam().runSyntax(param,
|
|
48
|
+
const p = new form_param_1.FormParam().runSyntax(param, input);
|
|
49
49
|
let type = p.getType();
|
|
50
50
|
const isStructure = param.findDirectTokenByText("STRUCTURE") !== undefined;
|
|
51
51
|
if (isStructure) {
|
|
@@ -57,22 +57,22 @@ class FormDefinition extends _identifier_1.Identifier {
|
|
|
57
57
|
else if (!(type instanceof basic_1.UnknownType) && !(type instanceof basic_1.VoidType)) {
|
|
58
58
|
type = new basic_1.UnknownType("FORM TABLES type must be table type");
|
|
59
59
|
}
|
|
60
|
-
ret.push(new _typed_identifier_1.TypedIdentifier(p.getToken(), filename, type, ["form_parameter" /* IdentifierMeta.FormParameter */]));
|
|
60
|
+
ret.push(new _typed_identifier_1.TypedIdentifier(p.getToken(), input.filename, type, ["form_parameter" /* IdentifierMeta.FormParameter */]));
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
return ret;
|
|
64
64
|
}
|
|
65
|
-
findType(type,
|
|
65
|
+
findType(type, input) {
|
|
66
66
|
const found = this.node.findFirstExpression(type);
|
|
67
67
|
if (found === undefined) {
|
|
68
68
|
return [];
|
|
69
69
|
}
|
|
70
|
-
return this.findParams(found,
|
|
70
|
+
return this.findParams(found, input);
|
|
71
71
|
}
|
|
72
|
-
findParams(node,
|
|
72
|
+
findParams(node, input) {
|
|
73
73
|
const res = [];
|
|
74
74
|
for (const param of node.findAllExpressions(Expressions.FormParam)) {
|
|
75
|
-
const p = new form_param_1.FormParam().runSyntax(param,
|
|
75
|
+
const p = new form_param_1.FormParam().runSyntax(param, input);
|
|
76
76
|
res.push(p);
|
|
77
77
|
}
|
|
78
78
|
return res;
|
|
@@ -16,19 +16,19 @@ const class_constant_1 = require("./class_constant");
|
|
|
16
16
|
const _typed_identifier_1 = require("./_typed_identifier");
|
|
17
17
|
const tokens_1 = require("../1_lexer/tokens");
|
|
18
18
|
class InterfaceDefinition extends _identifier_1.Identifier {
|
|
19
|
-
constructor(node,
|
|
19
|
+
constructor(node, input) {
|
|
20
20
|
if (!(node.get() instanceof Structures.Interface)) {
|
|
21
21
|
throw new Error("InterfaceDefinition, unexpected node type");
|
|
22
22
|
}
|
|
23
23
|
const name = node.findFirstStatement(Statements.Interface).findFirstExpression(Expressions.InterfaceName).getFirstToken();
|
|
24
|
-
super(name, filename);
|
|
25
|
-
scope.addInterfaceDefinition(this);
|
|
24
|
+
super(name, input.filename);
|
|
25
|
+
input.scope.addInterfaceDefinition(this);
|
|
26
26
|
this.events = [];
|
|
27
27
|
this.implementing = [];
|
|
28
28
|
this.globalValue = node.findFirstExpression(Expressions.ClassGlobal) !== undefined;
|
|
29
|
-
scope.push(_scope_type_1.ScopeType.Interface, name.getStr(), node.getFirstToken().getStart(), filename);
|
|
30
|
-
this.parse(
|
|
31
|
-
scope.pop(node.getLastToken().getEnd());
|
|
29
|
+
input.scope.push(_scope_type_1.ScopeType.Interface, name.getStr(), node.getFirstToken().getStart(), input.filename);
|
|
30
|
+
this.parse(input, node);
|
|
31
|
+
input.scope.pop(node.getLastToken().getEnd());
|
|
32
32
|
}
|
|
33
33
|
getSuperClass() {
|
|
34
34
|
return undefined;
|
|
@@ -58,57 +58,58 @@ class InterfaceDefinition extends _identifier_1.Identifier {
|
|
|
58
58
|
return this.methodDefinitions;
|
|
59
59
|
}
|
|
60
60
|
/////////////////
|
|
61
|
-
parse(
|
|
61
|
+
parse(input, node) {
|
|
62
62
|
var _a;
|
|
63
63
|
// todo, proper sequencing, the statements should be processed line by line
|
|
64
|
-
this.attributes = new class_attributes_1.Attributes(node,
|
|
64
|
+
this.attributes = new class_attributes_1.Attributes(node, input);
|
|
65
65
|
this.typeDefinitions = this.attributes.getTypes();
|
|
66
|
-
this.aliases = new aliases_1.Aliases(node, this.filename, scope);
|
|
66
|
+
this.aliases = new aliases_1.Aliases(node, this.filename, input.scope);
|
|
67
67
|
// todo, cleanup aliases, vs "object_oriented.ts" vs "class_implementation.ts"
|
|
68
|
+
// this adds the aliased types to scope?
|
|
68
69
|
for (const a of this.aliases.getAll()) {
|
|
69
70
|
const [objName, fieldName] = a.getComponent().split("~");
|
|
70
|
-
const idef = scope.findInterfaceDefinition(objName);
|
|
71
|
+
const idef = input.scope.findInterfaceDefinition(objName);
|
|
71
72
|
if (idef) {
|
|
72
73
|
const foundType = idef.getTypeDefinitions().getByName(fieldName);
|
|
73
74
|
if (foundType) {
|
|
74
|
-
scope.addTypeNamed(a.getName(), foundType);
|
|
75
|
+
input.scope.addTypeNamed(a.getName(), foundType);
|
|
75
76
|
}
|
|
76
77
|
else {
|
|
77
78
|
const foundField = idef.getAttributes().findByName(fieldName);
|
|
78
79
|
if (foundField && foundField instanceof class_constant_1.ClassConstant) {
|
|
79
80
|
const token = new tokens_1.Identifier(a.getStart(), a.getName());
|
|
80
|
-
const id = new _typed_identifier_1.TypedIdentifier(token, filename, foundField.getType());
|
|
81
|
+
const id = new _typed_identifier_1.TypedIdentifier(token, input.filename, foundField.getType());
|
|
81
82
|
const constant = new class_constant_1.ClassConstant(id, visibility_1.Visibility.Public, foundField.getValue());
|
|
82
|
-
scope.addIdentifier(constant);
|
|
83
|
+
input.scope.addIdentifier(constant);
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
this.methodDefinitions = new method_definitions_1.MethodDefinitions(node, this.filename, scope);
|
|
88
|
-
if (this.methodDefinitions.getByName("CONSTRUCTOR") !== undefined) {
|
|
89
|
-
throw new Error("Interfaces cannot have constructor methods");
|
|
90
|
-
}
|
|
91
88
|
const events = node.findAllStatements(Statements.Events);
|
|
92
89
|
for (const e of events) {
|
|
93
|
-
this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public,
|
|
90
|
+
this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public, input));
|
|
94
91
|
}
|
|
95
92
|
for (const i of node.findAllStatements(Statements.InterfaceDef)) {
|
|
96
93
|
const token = (_a = i.findDirectExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
97
94
|
const name = token === null || token === void 0 ? void 0 : token.getStr();
|
|
98
95
|
if (name) {
|
|
99
96
|
this.implementing.push({ name, partial: false });
|
|
100
|
-
const idef = scope.findInterfaceDefinition(name);
|
|
97
|
+
const idef = input.scope.findInterfaceDefinition(name);
|
|
101
98
|
if (idef) {
|
|
102
|
-
scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooName: name.toUpperCase(), ooType: "INTF" });
|
|
99
|
+
input.scope.addReference(token, idef, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooName: name.toUpperCase(), ooType: "INTF" });
|
|
103
100
|
}
|
|
104
|
-
else if (scope.getDDIC().inErrorNamespace(name) === false) {
|
|
105
|
-
scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename);
|
|
101
|
+
else if (input.scope.getDDIC().inErrorNamespace(name) === false) {
|
|
102
|
+
input.scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename);
|
|
106
103
|
}
|
|
107
104
|
else {
|
|
108
105
|
throw new Error("Interface " + name + " unknown");
|
|
109
106
|
}
|
|
110
107
|
}
|
|
111
108
|
}
|
|
109
|
+
this.methodDefinitions = new method_definitions_1.MethodDefinitions(node, input);
|
|
110
|
+
if (this.methodDefinitions.getByName("CONSTRUCTOR") !== undefined) {
|
|
111
|
+
throw new Error("Interfaces cannot have constructor methods");
|
|
112
|
+
}
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
exports.InterfaceDefinition = InterfaceDefinition;
|
|
@@ -8,7 +8,7 @@ const _identifier_1 = require("../4_file_information/_identifier");
|
|
|
8
8
|
const _reference_1 = require("../5_syntax/_reference");
|
|
9
9
|
class MethodDefinition extends _identifier_1.Identifier {
|
|
10
10
|
// todo: final flag
|
|
11
|
-
constructor(node, visibility,
|
|
11
|
+
constructor(node, visibility, input) {
|
|
12
12
|
var _a, _b;
|
|
13
13
|
if (!(node.get() instanceof statements_1.MethodDef)) {
|
|
14
14
|
throw new Error("MethodDefinition, expected MethodDef as part of input node");
|
|
@@ -17,15 +17,15 @@ class MethodDefinition extends _identifier_1.Identifier {
|
|
|
17
17
|
if (found === undefined) {
|
|
18
18
|
throw new Error("MethodDefinition, expected MethodDef as part of input node");
|
|
19
19
|
}
|
|
20
|
-
super(found.getFirstToken(), filename);
|
|
20
|
+
super(found.getFirstToken(), input.filename);
|
|
21
21
|
this.redefinition = false;
|
|
22
22
|
if (node.findDirectExpression(Expressions.Redefinition)) {
|
|
23
23
|
this.redefinition = true;
|
|
24
24
|
const name = found.getFirstToken().getStr();
|
|
25
25
|
if (name.includes("~")) {
|
|
26
|
-
const idef = scope.findInterfaceDefinition(name.split("~")[0]);
|
|
26
|
+
const idef = input.scope.findInterfaceDefinition(name.split("~")[0]);
|
|
27
27
|
if (idef) {
|
|
28
|
-
scope.addReference(found.getFirstToken(), idef, _reference_1.ReferenceType.ObjectOrientedReference, filename);
|
|
28
|
+
input.scope.addReference(found.getFirstToken(), idef, _reference_1.ReferenceType.ObjectOrientedReference, input.filename);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -47,15 +47,15 @@ class MethodDefinition extends _identifier_1.Identifier {
|
|
|
47
47
|
const token = r.getFirstToken();
|
|
48
48
|
const name = token.getStr();
|
|
49
49
|
this.raising.push(name);
|
|
50
|
-
const clas = scope.findClassDefinition(name);
|
|
50
|
+
const clas = input.scope.findClassDefinition(name);
|
|
51
51
|
if (clas) {
|
|
52
|
-
scope.addReference(token, clas, _reference_1.ReferenceType.ObjectOrientedReference, filename, { ooName: name.toUpperCase(), ooType: "CLAS" });
|
|
52
|
+
input.scope.addReference(token, clas, _reference_1.ReferenceType.ObjectOrientedReference, input.filename, { ooName: name.toUpperCase(), ooType: "CLAS" });
|
|
53
53
|
}
|
|
54
|
-
else if (scope.getDDIC().inErrorNamespace(name) === false) {
|
|
55
|
-
scope.addReference(token, clas, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, { ooName: name.toUpperCase(), ooType: "CLAS" });
|
|
54
|
+
else if (input.scope.getDDIC().inErrorNamespace(name) === false) {
|
|
55
|
+
input.scope.addReference(token, clas, _reference_1.ReferenceType.ObjectOrientedVoidReference, input.filename, { ooName: name.toUpperCase(), ooType: "CLAS" });
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
|
-
scope.addReference(token, clas, _reference_1.ReferenceType.ObjectOrientedUnknownReference, filename, { ooName: name.toUpperCase(), ooType: "CLAS" });
|
|
58
|
+
input.scope.addReference(token, clas, _reference_1.ReferenceType.ObjectOrientedUnknownReference, input.filename, { ooName: name.toUpperCase(), ooType: "CLAS" });
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
this.exceptions = [];
|
|
@@ -65,7 +65,7 @@ class MethodDefinition extends _identifier_1.Identifier {
|
|
|
65
65
|
this.exceptions.push(name);
|
|
66
66
|
}
|
|
67
67
|
this.visibility = visibility;
|
|
68
|
-
this.parameters = new method_parameters_1.MethodParameters(node,
|
|
68
|
+
this.parameters = new method_parameters_1.MethodParameters(node, input, this.abstract);
|
|
69
69
|
}
|
|
70
70
|
getVisibility() {
|
|
71
71
|
return this.visibility;
|
|
@@ -6,11 +6,10 @@ const Structures = require("../3_structures/structures");
|
|
|
6
6
|
const statements_1 = require("../2_statements/statements");
|
|
7
7
|
const visibility_1 = require("../4_file_information/visibility");
|
|
8
8
|
class MethodDefinitions {
|
|
9
|
-
constructor(node,
|
|
9
|
+
constructor(node, input) {
|
|
10
10
|
this.all = {};
|
|
11
11
|
this.all = {};
|
|
12
|
-
this.
|
|
13
|
-
this.parse(node, scope);
|
|
12
|
+
this.parse(node, input);
|
|
14
13
|
}
|
|
15
14
|
*getAll() {
|
|
16
15
|
for (const a in this.all) {
|
|
@@ -24,17 +23,17 @@ class MethodDefinitions {
|
|
|
24
23
|
return this.all[name.toUpperCase()];
|
|
25
24
|
}
|
|
26
25
|
///////////////////////
|
|
27
|
-
parseInterface(node,
|
|
26
|
+
parseInterface(node, input) {
|
|
28
27
|
const defs = node.findAllStatements(statements_1.MethodDef);
|
|
29
28
|
for (const def of defs) {
|
|
30
|
-
const m = new method_definition_1.MethodDefinition(def, visibility_1.Visibility.Public,
|
|
29
|
+
const m = new method_definition_1.MethodDefinition(def, visibility_1.Visibility.Public, input);
|
|
31
30
|
this.all[m.getName().toUpperCase()] = m;
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
|
-
parse(node,
|
|
33
|
+
parse(node, input) {
|
|
35
34
|
const idef = node.findDirectStructure(Structures.Interface);
|
|
36
35
|
if (idef) {
|
|
37
|
-
return this.parseInterface(node,
|
|
36
|
+
return this.parseInterface(node, input);
|
|
38
37
|
}
|
|
39
38
|
const cdef = node.findDirectStructure(Structures.ClassDefinition);
|
|
40
39
|
if (!cdef) {
|
|
@@ -42,17 +41,17 @@ class MethodDefinitions {
|
|
|
42
41
|
}
|
|
43
42
|
const pri = cdef.findDirectStructure(Structures.PrivateSection);
|
|
44
43
|
for (const def of (pri === null || pri === void 0 ? void 0 : pri.findAllStatements(statements_1.MethodDef)) || []) {
|
|
45
|
-
const m = new method_definition_1.MethodDefinition(def, visibility_1.Visibility.Private,
|
|
44
|
+
const m = new method_definition_1.MethodDefinition(def, visibility_1.Visibility.Private, input);
|
|
46
45
|
this.all[m.getName().toUpperCase()] = m;
|
|
47
46
|
}
|
|
48
47
|
const pro = node.findDirectStructure(Structures.ProtectedSection);
|
|
49
48
|
for (const def of (pro === null || pro === void 0 ? void 0 : pro.findAllStatements(statements_1.MethodDef)) || []) {
|
|
50
|
-
const m = new method_definition_1.MethodDefinition(def, visibility_1.Visibility.Protected,
|
|
49
|
+
const m = new method_definition_1.MethodDefinition(def, visibility_1.Visibility.Protected, input);
|
|
51
50
|
this.all[m.getName().toUpperCase()] = m;
|
|
52
51
|
}
|
|
53
52
|
const pub = node.findDirectStructure(Structures.PublicSection);
|
|
54
53
|
for (const def of (pub === null || pub === void 0 ? void 0 : pub.findAllStatements(statements_1.MethodDef)) || []) {
|
|
55
|
-
const m = new method_definition_1.MethodDefinition(def, visibility_1.Visibility.Public,
|
|
54
|
+
const m = new method_definition_1.MethodDefinition(def, visibility_1.Visibility.Public, input);
|
|
56
55
|
this.all[m.getName().toUpperCase()] = m;
|
|
57
56
|
}
|
|
58
57
|
}
|
|
@@ -16,7 +16,7 @@ const _scope_type_1 = require("../5_syntax/_scope_type");
|
|
|
16
16
|
// this.exceptions = [];
|
|
17
17
|
// also consider RAISING vs EXCEPTIONS
|
|
18
18
|
class MethodParameters {
|
|
19
|
-
constructor(node,
|
|
19
|
+
constructor(node, input, abstractMethod) {
|
|
20
20
|
if (!(node.get() instanceof method_def_1.MethodDef)) {
|
|
21
21
|
throw new Error("MethodDefinition, expected MethodDef as part of input node");
|
|
22
22
|
}
|
|
@@ -28,12 +28,12 @@ class MethodParameters {
|
|
|
28
28
|
this.returning = undefined;
|
|
29
29
|
this.preferred = undefined;
|
|
30
30
|
this.exceptions = [];
|
|
31
|
-
this.filename = filename;
|
|
31
|
+
this.filename = input.filename;
|
|
32
32
|
// need the scope for LIKE typing inside method parameters
|
|
33
|
-
const parentName = scope.getName();
|
|
34
|
-
scope.push(_scope_type_1.ScopeType.MethodDefinition, "method definition", node.getStart(), filename);
|
|
35
|
-
this.parse(node,
|
|
36
|
-
scope.pop(node.getEnd());
|
|
33
|
+
const parentName = input.scope.getName();
|
|
34
|
+
input.scope.push(_scope_type_1.ScopeType.MethodDefinition, "method definition", node.getStart(), input.filename);
|
|
35
|
+
this.parse(node, input, parentName, abstractMethod);
|
|
36
|
+
input.scope.pop(node.getEnd());
|
|
37
37
|
}
|
|
38
38
|
getFilename() {
|
|
39
39
|
return this.filename;
|
|
@@ -108,22 +108,22 @@ class MethodParameters {
|
|
|
108
108
|
return this.defaults[parameter.toUpperCase()];
|
|
109
109
|
}
|
|
110
110
|
///////////////////
|
|
111
|
-
parse(node,
|
|
111
|
+
parse(node, input, parentName, abstractMethod) {
|
|
112
112
|
var _a, _b;
|
|
113
113
|
const handler = node.findFirstExpression(Expressions.EventHandler);
|
|
114
114
|
if (handler) {
|
|
115
115
|
const nameToken = (_a = node.findFirstExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
116
116
|
const ooName = nameToken === null || nameToken === void 0 ? void 0 : nameToken.getStr();
|
|
117
|
-
const def = scope.findObjectDefinition(ooName);
|
|
118
|
-
const doVoid = def ? false : !scope.getDDIC().inErrorNamespace(ooName);
|
|
117
|
+
const def = input.scope.findObjectDefinition(ooName);
|
|
118
|
+
const doVoid = def ? false : !input.scope.getDDIC().inErrorNamespace(ooName);
|
|
119
119
|
if (def) {
|
|
120
|
-
scope.addReference(nameToken, def, _reference_1.ReferenceType.ObjectOrientedReference, filename);
|
|
120
|
+
input.scope.addReference(nameToken, def, _reference_1.ReferenceType.ObjectOrientedReference, input.filename);
|
|
121
121
|
}
|
|
122
122
|
else if (doVoid && ooName) {
|
|
123
|
-
scope.addReference(nameToken, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: ooName.toUpperCase() });
|
|
123
|
+
input.scope.addReference(nameToken, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: ooName.toUpperCase() });
|
|
124
124
|
}
|
|
125
125
|
const eventName = (_b = node.findFirstExpression(Expressions.EventName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();
|
|
126
|
-
const event = new _object_oriented_1.ObjectOriented(scope).searchEvent(def, eventName);
|
|
126
|
+
const event = new _object_oriented_1.ObjectOriented(input.scope).searchEvent(def, eventName);
|
|
127
127
|
for (const p of handler.findAllExpressions(Expressions.MethodParamName)) {
|
|
128
128
|
const token = p.getFirstToken();
|
|
129
129
|
const search = token.getStr().toUpperCase().replace("!", "");
|
|
@@ -148,7 +148,7 @@ class MethodParameters {
|
|
|
148
148
|
}
|
|
149
149
|
const importing = node.findFirstExpression(Expressions.MethodDefImporting);
|
|
150
150
|
if (importing) {
|
|
151
|
-
this.add(this.importing, importing,
|
|
151
|
+
this.add(this.importing, importing, input, ["importing" /* IdentifierMeta.MethodImporting */], abstractMethod);
|
|
152
152
|
if (importing.findDirectTokenByText("PREFERRED")) {
|
|
153
153
|
this.preferred = importing.getLastToken().getStr().toUpperCase();
|
|
154
154
|
if (this.preferred.startsWith("!")) {
|
|
@@ -158,19 +158,19 @@ class MethodParameters {
|
|
|
158
158
|
}
|
|
159
159
|
const exporting = node.findFirstExpression(Expressions.MethodDefExporting);
|
|
160
160
|
if (exporting) {
|
|
161
|
-
this.add(this.exporting, exporting,
|
|
161
|
+
this.add(this.exporting, exporting, input, ["exporting" /* IdentifierMeta.MethodExporting */], abstractMethod);
|
|
162
162
|
}
|
|
163
163
|
const changing = node.findFirstExpression(Expressions.MethodDefChanging);
|
|
164
164
|
if (changing) {
|
|
165
|
-
this.add(this.changing, changing,
|
|
165
|
+
this.add(this.changing, changing, input, ["changing" /* IdentifierMeta.MethodChanging */], abstractMethod);
|
|
166
166
|
}
|
|
167
167
|
const returning = node.findFirstExpression(Expressions.MethodDefReturning);
|
|
168
168
|
if (returning) {
|
|
169
|
-
this.returning = new method_def_returning_1.MethodDefReturning().runSyntax(returning,
|
|
169
|
+
this.returning = new method_def_returning_1.MethodDefReturning().runSyntax(returning, input, ["returning" /* IdentifierMeta.MethodReturning */]);
|
|
170
170
|
}
|
|
171
|
-
this.workaroundRAP(node,
|
|
171
|
+
this.workaroundRAP(node, input, parentName);
|
|
172
172
|
}
|
|
173
|
-
workaroundRAP(node,
|
|
173
|
+
workaroundRAP(node, input, parentName) {
|
|
174
174
|
const resultName = node.findExpressionAfterToken("RESULT");
|
|
175
175
|
const isRap = node.findExpressionAfterToken("IMPORTING");
|
|
176
176
|
if (isRap) {
|
|
@@ -178,7 +178,7 @@ class MethodParameters {
|
|
|
178
178
|
if (foo === resultName) {
|
|
179
179
|
continue;
|
|
180
180
|
}
|
|
181
|
-
this.importing.push(new _typed_identifier_1.TypedIdentifier(foo.getFirstToken(), filename, new basic_1.VoidType("RapMethodParameter"), ["importing" /* IdentifierMeta.MethodImporting */]));
|
|
181
|
+
this.importing.push(new _typed_identifier_1.TypedIdentifier(foo.getFirstToken(), input.filename, new basic_1.VoidType("RapMethodParameter"), ["importing" /* IdentifierMeta.MethodImporting */]));
|
|
182
182
|
}
|
|
183
183
|
const concat = node.concatTokens().toUpperCase();
|
|
184
184
|
if (concat.includes(" FOR VALIDATE ")
|
|
@@ -186,30 +186,30 @@ class MethodParameters {
|
|
|
186
186
|
|| concat.includes(" FOR FEATURES ")
|
|
187
187
|
|| concat.includes(" FOR MODIFY ")) {
|
|
188
188
|
const token = isRap.getFirstToken();
|
|
189
|
-
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "failed"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
190
|
-
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "mapped"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
191
|
-
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "reported"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
189
|
+
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "failed"), input.filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
190
|
+
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "mapped"), input.filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
191
|
+
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "reported"), input.filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
if (resultName) {
|
|
195
195
|
const token = resultName.getFirstToken();
|
|
196
|
-
this.importing.push(new _typed_identifier_1.TypedIdentifier(token, filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
196
|
+
this.importing.push(new _typed_identifier_1.TypedIdentifier(token, input.filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
197
197
|
}
|
|
198
198
|
// its some kind of magic
|
|
199
199
|
if (parentName.toUpperCase() === "CL_ABAP_BEHAVIOR_SAVER") {
|
|
200
|
-
const tempChanging = this.changing.map(c => new _typed_identifier_1.TypedIdentifier(c.getToken(), filename, new basic_1.VoidType("RapMethodParameter"), c.getMeta()));
|
|
200
|
+
const tempChanging = this.changing.map(c => new _typed_identifier_1.TypedIdentifier(c.getToken(), input.filename, new basic_1.VoidType("RapMethodParameter"), c.getMeta()));
|
|
201
201
|
while (this.changing.length > 0) {
|
|
202
202
|
this.changing.shift();
|
|
203
203
|
}
|
|
204
204
|
this.changing.push(...tempChanging);
|
|
205
|
-
const tempImporting = this.importing.map(c => new _typed_identifier_1.TypedIdentifier(c.getToken(), filename, new basic_1.VoidType("RapMethodParameter"), c.getMeta()));
|
|
205
|
+
const tempImporting = this.importing.map(c => new _typed_identifier_1.TypedIdentifier(c.getToken(), input.filename, new basic_1.VoidType("RapMethodParameter"), c.getMeta()));
|
|
206
206
|
while (this.importing.length > 0) {
|
|
207
207
|
this.importing.shift();
|
|
208
208
|
}
|
|
209
209
|
this.importing.push(...tempImporting);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
add(target, source,
|
|
212
|
+
add(target, source, input, meta, abstractMethod) {
|
|
213
213
|
var _a, _b;
|
|
214
214
|
for (const opt of source.findAllExpressions(Expressions.MethodParamOptional)) {
|
|
215
215
|
const p = opt.findDirectExpression(Expressions.MethodParam);
|
|
@@ -226,8 +226,8 @@ class MethodParameters {
|
|
|
226
226
|
if (abstractMethod === true) {
|
|
227
227
|
extraMeta.push("abstract" /* IdentifierMeta.Abstract */);
|
|
228
228
|
}
|
|
229
|
-
const id = new method_param_1.MethodParam().runSyntax(p,
|
|
230
|
-
scope.addIdentifier(id);
|
|
229
|
+
const id = new method_param_1.MethodParam().runSyntax(p, input, [...meta, ...extraMeta]);
|
|
230
|
+
input.scope.addIdentifier(id);
|
|
231
231
|
target.push(id);
|
|
232
232
|
if (opt.findDirectTokenByText("OPTIONAL")) {
|
|
233
233
|
const name = target[target.length - 1].getName().toUpperCase();
|
|
@@ -247,7 +247,7 @@ class MethodParameters {
|
|
|
247
247
|
}
|
|
248
248
|
const params = source.findAllExpressions(Expressions.MethodParam);
|
|
249
249
|
for (const param of params) {
|
|
250
|
-
target.push(new method_param_1.MethodParam().runSyntax(param,
|
|
250
|
+
target.push(new method_param_1.MethodParam().runSyntax(param, input, meta));
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
}
|
package/build/src/issue.js
CHANGED
|
@@ -75,6 +75,18 @@ class Issue {
|
|
|
75
75
|
defaultFix: fix,
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
static atTokenFilename(filename, token, message, key, severity, fix) {
|
|
79
|
+
severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;
|
|
80
|
+
return new Issue({
|
|
81
|
+
filename: filename,
|
|
82
|
+
message,
|
|
83
|
+
key,
|
|
84
|
+
start: token.getStart(),
|
|
85
|
+
end: token.getEnd(),
|
|
86
|
+
severity,
|
|
87
|
+
defaultFix: fix,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
78
90
|
static atIdentifier(identifier, message, key, severity, fix) {
|
|
79
91
|
severity = severity !== null && severity !== void 0 ? severity : severity_1.Severity.Error;
|
|
80
92
|
return new Issue({
|
package/build/src/registry.js
CHANGED
|
@@ -7,6 +7,7 @@ const _abap_object_1 = require("../objects/_abap_object");
|
|
|
7
7
|
const issue_1 = require("../issue");
|
|
8
8
|
const _irule_1 = require("./_irule");
|
|
9
9
|
const severity_1 = require("../severity");
|
|
10
|
+
const _syntax_input_1 = require("../abap/5_syntax/_syntax_input");
|
|
10
11
|
class CheckSyntaxConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
11
12
|
}
|
|
12
13
|
exports.CheckSyntaxConf = CheckSyntaxConf;
|
|
@@ -16,7 +17,7 @@ class CheckSyntax {
|
|
|
16
17
|
}
|
|
17
18
|
getMetadata() {
|
|
18
19
|
return {
|
|
19
|
-
key:
|
|
20
|
+
key: _syntax_input_1.CheckSyntaxKey,
|
|
20
21
|
title: "Check syntax",
|
|
21
22
|
shortDescription: `Enables syntax check and variable resolution`,
|
|
22
23
|
tags: [_irule_1.RuleTag.Syntax],
|
|
@@ -16,6 +16,8 @@ class DoubleSpaceConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
16
16
|
super(...arguments);
|
|
17
17
|
/** Check for double space after keywords */
|
|
18
18
|
this.keywords = true;
|
|
19
|
+
/** list of keywords to skip, case insensitive */
|
|
20
|
+
this.skipKeywords = ["CHANGING", "EXPORTING", "OTHERS"];
|
|
19
21
|
/** Check for double space after start parenthesis */
|
|
20
22
|
this.startParen = true;
|
|
21
23
|
/** Check for double space before end parenthesis */
|
|
@@ -48,6 +50,9 @@ class DoubleSpace extends _abap_rule_1.ABAPRule {
|
|
|
48
50
|
}
|
|
49
51
|
setConfig(conf) {
|
|
50
52
|
this.conf = conf;
|
|
53
|
+
if (this.conf.skipKeywords === undefined) {
|
|
54
|
+
this.conf.skipKeywords = new DoubleSpaceConf().skipKeywords;
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
runParsed(file) {
|
|
53
58
|
let issues = [];
|
|
@@ -159,9 +164,7 @@ class DoubleSpace extends _abap_rule_1.ABAPRule {
|
|
|
159
164
|
if (prev instanceof nodes_1.TokenNodeRegex
|
|
160
165
|
|| upper === "("
|
|
161
166
|
|| upper === ")"
|
|
162
|
-
||
|
|
163
|
-
|| upper === "EXPORTING"
|
|
164
|
-
|| upper === "OTHERS") {
|
|
167
|
+
|| this.getConfig().skipKeywords.some(e => e.toUpperCase() === upper)) {
|
|
165
168
|
// not a keyword, continue
|
|
166
169
|
prev = n;
|
|
167
170
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.112.1",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.47.
|
|
53
|
+
"@microsoft/api-extractor": "^7.47.2",
|
|
54
54
|
"@types/chai": "^4.3.16",
|
|
55
55
|
"@types/mocha": "^10.0.7",
|
|
56
|
-
"@types/node": "^20.14.
|
|
56
|
+
"@types/node": "^20.14.11",
|
|
57
57
|
"chai": "^4.4.1",
|
|
58
58
|
"eslint": "^8.57.0",
|
|
59
59
|
"mocha": "^10.6.0",
|