@abaplint/core 2.105.16 → 2.105.17
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/README.md +6 -6
- package/build/abaplint.d.ts +1 -0
- package/build/adhoc/syntax_performance.js +165 -165
- package/build/src/abap/2_statements/expressions/raise_with.js +1 -1
- package/build/src/abap/5_syntax/expressions/raise_with.js +1 -1
- package/build/src/abap/5_syntax/statements/modify_internal.js +22 -2
- package/build/src/abap/5_syntax/statements/parameter.js +3 -0
- package/build/src/abap/flow/flow_graph.js +7 -7
- package/build/src/abap/nodes/expression_node.js +26 -0
- package/build/src/lsp/help.js +7 -7
- package/build/src/registry.js +1 -1
- package/build/src/rules/7bit_ascii.js +4 -4
- package/build/src/rules/abapdoc.js +4 -4
- package/build/src/rules/align_parameters.js +40 -40
- package/build/src/rules/ambiguous_statement.js +6 -6
- package/build/src/rules/avoid_use.js +24 -13
- package/build/src/rules/begin_end_names.js +4 -4
- package/build/src/rules/begin_single_include.js +12 -12
- package/build/src/rules/call_transaction_authority_check.js +3 -3
- package/build/src/rules/cds_comment_style.js +4 -4
- package/build/src/rules/cds_legacy_view.js +4 -4
- package/build/src/rules/chain_mainly_declarations.js +4 -4
- package/build/src/rules/change_if_to_case.js +8 -8
- package/build/src/rules/check_abstract.js +2 -2
- package/build/src/rules/check_comments.js +4 -4
- package/build/src/rules/check_include.js +3 -3
- package/build/src/rules/check_subrc.js +8 -8
- package/build/src/rules/classic_exceptions_overlap.js +10 -10
- package/build/src/rules/commented_code.js +1 -1
- package/build/src/rules/constructor_visibility_public.js +4 -4
- package/build/src/rules/contains_tab.js +2 -2
- package/build/src/rules/cyclic_oo.js +4 -4
- package/build/src/rules/dangerous_statement.js +1 -1
- package/build/src/rules/definitions_top.js +6 -6
- package/build/src/rules/downport.js +84 -84
- package/build/src/rules/easy_to_find_messages.js +6 -6
- package/build/src/rules/empty_line_in_statement.js +2 -2
- package/build/src/rules/exit_or_check.js +3 -3
- package/build/src/rules/expand_macros.js +5 -5
- package/build/src/rules/exporting.js +1 -1
- package/build/src/rules/forbidden_identifier.js +1 -1
- package/build/src/rules/forbidden_void_type.js +2 -2
- package/build/src/rules/fully_type_itabs.js +1 -1
- package/build/src/rules/functional_writing.js +17 -17
- package/build/src/rules/global_class.js +8 -8
- package/build/src/rules/identical_conditions.js +2 -2
- package/build/src/rules/identical_contents.js +14 -14
- package/build/src/rules/identical_descriptions.js +6 -6
- package/build/src/rules/if_in_if.js +35 -35
- package/build/src/rules/implement_methods.js +3 -3
- package/build/src/rules/in_statement_indentation.js +11 -11
- package/build/src/rules/intf_referencing_clas.js +3 -3
- package/build/src/rules/line_break_style.js +2 -2
- package/build/src/rules/line_length.js +1 -1
- package/build/src/rules/line_only_punc.js +1 -1
- package/build/src/rules/local_variable_names.js +2 -2
- package/build/src/rules/main_file_contents.js +4 -4
- package/build/src/rules/many_parentheses.js +10 -10
- package/build/src/rules/max_one_method_parameter_per_line.js +7 -7
- package/build/src/rules/max_one_statement.js +5 -5
- package/build/src/rules/method_length.js +9 -2
- package/build/src/rules/method_overwrites_builtin.js +4 -4
- package/build/src/rules/nesting.js +1 -1
- package/build/src/rules/no_chained_assignment.js +1 -1
- package/build/src/rules/no_external_form_calls.js +2 -2
- package/build/src/rules/no_inline_in_optional_branches.js +11 -11
- package/build/src/rules/no_prefixes.js +6 -6
- package/build/src/rules/no_public_attributes.js +1 -1
- package/build/src/rules/no_yoda_conditions.js +4 -4
- package/build/src/rules/nrob_consistency.js +2 -2
- package/build/src/rules/obsolete_statement.js +51 -51
- package/build/src/rules/omit_parameter_name.js +3 -3
- package/build/src/rules/omit_receiving.js +13 -13
- package/build/src/rules/parser_702_chaining.js +2 -2
- package/build/src/rules/parser_error.js +2 -2
- package/build/src/rules/parser_missing_space.js +1 -1
- package/build/src/rules/prefer_inline.js +16 -16
- package/build/src/rules/prefer_is_not.js +9 -9
- package/build/src/rules/prefer_raise_exception_new.js +5 -5
- package/build/src/rules/prefer_returning_to_exporting.js +1 -1
- package/build/src/rules/prefer_xsdbool.js +2 -2
- package/build/src/rules/reduce_procedural_code.js +17 -17
- package/build/src/rules/remove_descriptions.js +4 -4
- package/build/src/rules/rfc_error_handling.js +9 -9
- package/build/src/rules/select_add_order_by.js +5 -5
- package/build/src/rules/select_performance.js +5 -5
- package/build/src/rules/select_single_full_key.js +2 -2
- package/build/src/rules/sicf_consistency.js +2 -2
- package/build/src/rules/space_before_dot.js +2 -2
- package/build/src/rules/sql_value_conversion.js +6 -6
- package/build/src/rules/start_at_tab.js +1 -1
- package/build/src/rules/strict_sql.js +6 -6
- package/build/src/rules/sy_modification.js +3 -3
- package/build/src/rules/tabl_enhancement_category.js +2 -2
- package/build/src/rules/type_form_parameters.js +2 -2
- package/build/src/rules/unnecessary_pragma.js +29 -29
- package/build/src/rules/unnecessary_return.js +11 -11
- package/build/src/rules/unused_methods.js +11 -11
- package/build/src/rules/unused_variables.js +12 -12
- package/build/src/rules/use_bool_expression.js +8 -8
- package/build/src/rules/use_line_exists.js +6 -6
- package/build/src/rules/use_new.js +4 -4
- package/build/src/rules/when_others_last.js +6 -6
- package/package.json +70 -70
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# @abaplint/core
|
|
2
|
-
|
|
3
|
-
[abaplint](https://abaplint.org) core library
|
|
4
|
-
|
|
5
|
-
Exposes functionality like the parser and rules, which can be used in other projects.
|
|
6
|
-
|
|
1
|
+
# @abaplint/core
|
|
2
|
+
|
|
3
|
+
[abaplint](https://abaplint.org) core library
|
|
4
|
+
|
|
5
|
+
Exposes functionality like the parser and rules, which can be used in other projects.
|
|
6
|
+
|
|
7
7
|
For more information see https://github.com/abaplint/abaplint
|
package/build/abaplint.d.ts
CHANGED
|
@@ -2055,6 +2055,7 @@ declare class ExpressionNode extends AbstractNode<ExpressionNode | TokenNode> {
|
|
|
2055
2055
|
get(): IStatementRunnable;
|
|
2056
2056
|
countTokens(): number;
|
|
2057
2057
|
getFirstToken(): Token;
|
|
2058
|
+
concatTokensWithLinebreaks(): string;
|
|
2058
2059
|
concatTokens(): string;
|
|
2059
2060
|
concatTokensWithoutStringsAndComments(): string;
|
|
2060
2061
|
getTokens(): readonly Token[];
|
|
@@ -5,175 +5,175 @@ const fs = require("fs");
|
|
|
5
5
|
console.log("========================");
|
|
6
6
|
const file1 = new src_1.MemoryFile("abapgit.prog.abap", fs.readFileSync("./lexer_performance.abap", "utf-8"));
|
|
7
7
|
const reg = new src_1.Registry().addFile(file1);
|
|
8
|
-
reg.addFile(new src_1.MemoryFile("cx_root.clas.abap", `
|
|
9
|
-
CLASS cx_root DEFINITION ABSTRACT PUBLIC.
|
|
10
|
-
PUBLIC SECTION.
|
|
11
|
-
DATA previous TYPE REF TO cx_root.
|
|
12
|
-
DATA textid TYPE c LENGTH 32.
|
|
13
|
-
|
|
14
|
-
METHODS constructor
|
|
15
|
-
IMPORTING
|
|
16
|
-
textid LIKE textid OPTIONAL
|
|
17
|
-
previous TYPE REF TO cx_root OPTIONAL.
|
|
18
|
-
|
|
19
|
-
METHODS get_source_position
|
|
20
|
-
EXPORTING
|
|
21
|
-
program_name TYPE string
|
|
22
|
-
include_name TYPE string
|
|
23
|
-
source_line TYPE i.
|
|
24
|
-
|
|
25
|
-
INTERFACES if_message.
|
|
26
|
-
ALIASES get_longtext FOR if_message~get_longtext.
|
|
27
|
-
ALIASES get_text FOR if_message~get_text.
|
|
28
|
-
|
|
29
|
-
ENDCLASS.
|
|
30
|
-
|
|
31
|
-
CLASS cx_root IMPLEMENTATION.
|
|
32
|
-
|
|
33
|
-
METHOD constructor.
|
|
34
|
-
ENDMETHOD.
|
|
35
|
-
|
|
36
|
-
METHOD get_source_position.
|
|
37
|
-
ENDMETHOD.
|
|
38
|
-
|
|
39
|
-
METHOD if_message~get_longtext.
|
|
40
|
-
ENDMETHOD.
|
|
41
|
-
|
|
42
|
-
METHOD if_message~get_text.
|
|
43
|
-
ENDMETHOD.
|
|
44
|
-
|
|
8
|
+
reg.addFile(new src_1.MemoryFile("cx_root.clas.abap", `
|
|
9
|
+
CLASS cx_root DEFINITION ABSTRACT PUBLIC.
|
|
10
|
+
PUBLIC SECTION.
|
|
11
|
+
DATA previous TYPE REF TO cx_root.
|
|
12
|
+
DATA textid TYPE c LENGTH 32.
|
|
13
|
+
|
|
14
|
+
METHODS constructor
|
|
15
|
+
IMPORTING
|
|
16
|
+
textid LIKE textid OPTIONAL
|
|
17
|
+
previous TYPE REF TO cx_root OPTIONAL.
|
|
18
|
+
|
|
19
|
+
METHODS get_source_position
|
|
20
|
+
EXPORTING
|
|
21
|
+
program_name TYPE string
|
|
22
|
+
include_name TYPE string
|
|
23
|
+
source_line TYPE i.
|
|
24
|
+
|
|
25
|
+
INTERFACES if_message.
|
|
26
|
+
ALIASES get_longtext FOR if_message~get_longtext.
|
|
27
|
+
ALIASES get_text FOR if_message~get_text.
|
|
28
|
+
|
|
29
|
+
ENDCLASS.
|
|
30
|
+
|
|
31
|
+
CLASS cx_root IMPLEMENTATION.
|
|
32
|
+
|
|
33
|
+
METHOD constructor.
|
|
34
|
+
ENDMETHOD.
|
|
35
|
+
|
|
36
|
+
METHOD get_source_position.
|
|
37
|
+
ENDMETHOD.
|
|
38
|
+
|
|
39
|
+
METHOD if_message~get_longtext.
|
|
40
|
+
ENDMETHOD.
|
|
41
|
+
|
|
42
|
+
METHOD if_message~get_text.
|
|
43
|
+
ENDMETHOD.
|
|
44
|
+
|
|
45
45
|
ENDCLASS.`));
|
|
46
|
-
reg.addFile(new src_1.MemoryFile("cx_static_check.clas.abap", `
|
|
47
|
-
CLASS cx_static_check DEFINITION PUBLIC INHERITING FROM cx_root.
|
|
48
|
-
PUBLIC SECTION.
|
|
49
|
-
METHODS constructor
|
|
50
|
-
IMPORTING
|
|
51
|
-
textid LIKE textid OPTIONAL
|
|
52
|
-
previous TYPE REF TO cx_root OPTIONAL.
|
|
53
|
-
ENDCLASS.
|
|
54
|
-
|
|
55
|
-
CLASS cx_static_check IMPLEMENTATION.
|
|
56
|
-
METHOD constructor.
|
|
57
|
-
ENDMETHOD.
|
|
46
|
+
reg.addFile(new src_1.MemoryFile("cx_static_check.clas.abap", `
|
|
47
|
+
CLASS cx_static_check DEFINITION PUBLIC INHERITING FROM cx_root.
|
|
48
|
+
PUBLIC SECTION.
|
|
49
|
+
METHODS constructor
|
|
50
|
+
IMPORTING
|
|
51
|
+
textid LIKE textid OPTIONAL
|
|
52
|
+
previous TYPE REF TO cx_root OPTIONAL.
|
|
53
|
+
ENDCLASS.
|
|
54
|
+
|
|
55
|
+
CLASS cx_static_check IMPLEMENTATION.
|
|
56
|
+
METHOD constructor.
|
|
57
|
+
ENDMETHOD.
|
|
58
58
|
ENDCLASS.`));
|
|
59
|
-
reg.addFile(new src_1.MemoryFile("if_message.intf.abap", `
|
|
60
|
-
INTERFACE if_message PUBLIC.
|
|
61
|
-
METHODS get_text RETURNING VALUE(result) TYPE string.
|
|
62
|
-
|
|
63
|
-
METHODS get_longtext
|
|
64
|
-
IMPORTING preserve_newlines TYPE abap_bool OPTIONAL
|
|
65
|
-
RETURNING VALUE(result) TYPE string.
|
|
59
|
+
reg.addFile(new src_1.MemoryFile("if_message.intf.abap", `
|
|
60
|
+
INTERFACE if_message PUBLIC.
|
|
61
|
+
METHODS get_text RETURNING VALUE(result) TYPE string.
|
|
62
|
+
|
|
63
|
+
METHODS get_longtext
|
|
64
|
+
IMPORTING preserve_newlines TYPE abap_bool OPTIONAL
|
|
65
|
+
RETURNING VALUE(result) TYPE string.
|
|
66
66
|
ENDINTERFACE.`));
|
|
67
|
-
reg.addFile(new src_1.MemoryFile("if_t100_message.intf.abap", `
|
|
68
|
-
INTERFACE if_t100_message PUBLIC.
|
|
69
|
-
|
|
70
|
-
DATA t100key TYPE scx_t100key.
|
|
71
|
-
|
|
72
|
-
CONSTANTS:
|
|
73
|
-
BEGIN OF default_textid,
|
|
74
|
-
msgid TYPE symsgid VALUE 'AB',
|
|
75
|
-
msgno TYPE symsgno VALUE '123',
|
|
76
|
-
attr1 TYPE scx_attrname VALUE '',
|
|
77
|
-
attr2 TYPE scx_attrname VALUE '',
|
|
78
|
-
attr3 TYPE scx_attrname VALUE '',
|
|
79
|
-
attr4 TYPE scx_attrname VALUE '',
|
|
80
|
-
END OF default_textid.
|
|
81
|
-
|
|
67
|
+
reg.addFile(new src_1.MemoryFile("if_t100_message.intf.abap", `
|
|
68
|
+
INTERFACE if_t100_message PUBLIC.
|
|
69
|
+
|
|
70
|
+
DATA t100key TYPE scx_t100key.
|
|
71
|
+
|
|
72
|
+
CONSTANTS:
|
|
73
|
+
BEGIN OF default_textid,
|
|
74
|
+
msgid TYPE symsgid VALUE 'AB',
|
|
75
|
+
msgno TYPE symsgno VALUE '123',
|
|
76
|
+
attr1 TYPE scx_attrname VALUE '',
|
|
77
|
+
attr2 TYPE scx_attrname VALUE '',
|
|
78
|
+
attr3 TYPE scx_attrname VALUE '',
|
|
79
|
+
attr4 TYPE scx_attrname VALUE '',
|
|
80
|
+
END OF default_textid.
|
|
81
|
+
|
|
82
82
|
ENDINTERFACE.`));
|
|
83
|
-
reg.setConfig(new src_1.Config(`
|
|
84
|
-
{
|
|
85
|
-
"global": {
|
|
86
|
-
"files": "/src/**/*.*"
|
|
87
|
-
},
|
|
88
|
-
"dependencies": [],
|
|
89
|
-
"syntax": {
|
|
90
|
-
"version": "v702",
|
|
91
|
-
"errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)",
|
|
92
|
-
"globalConstants": [
|
|
93
|
-
"abap_func_exporting",
|
|
94
|
-
"abap_func_tables",
|
|
95
|
-
"cssf_formtype_text",
|
|
96
|
-
"icon_abap",
|
|
97
|
-
"icon_adopt",
|
|
98
|
-
"icon_change",
|
|
99
|
-
"icon_create",
|
|
100
|
-
"icon_delete",
|
|
101
|
-
"icon_display_text",
|
|
102
|
-
"icon_folder",
|
|
103
|
-
"icon_led_green",
|
|
104
|
-
"icon_led_inactive",
|
|
105
|
-
"icon_led_red",
|
|
106
|
-
"icon_led_yellow",
|
|
107
|
-
"icon_message_information",
|
|
108
|
-
"icon_okay",
|
|
109
|
-
"icon_set_state",
|
|
110
|
-
"icon_stack",
|
|
111
|
-
"icon_system_help",
|
|
112
|
-
"icon_workflow_fork",
|
|
113
|
-
"seoc_category_exception",
|
|
114
|
-
"seoc_category_webdynpro_class",
|
|
115
|
-
"seoc_exposure_private",
|
|
116
|
-
"seoc_exposure_protected",
|
|
117
|
-
"seoc_exposure_public",
|
|
118
|
-
"seoc_state_implemented",
|
|
119
|
-
"seoc_version_active",
|
|
120
|
-
"seoc_version_deleted",
|
|
121
|
-
"seoc_version_inactive",
|
|
122
|
-
"seok_access_free",
|
|
123
|
-
"seok_access_modify",
|
|
124
|
-
"seox_false",
|
|
125
|
-
"seok_pgmid_r3tr",
|
|
126
|
-
"seoo_cmptype_type",
|
|
127
|
-
"seoo_cmptype_event",
|
|
128
|
-
"seoo_cmptype_method",
|
|
129
|
-
"seoo_cmptype_attribute",
|
|
130
|
-
"seop_ext_class_locals_def",
|
|
131
|
-
"seop_ext_class_locals_imp",
|
|
132
|
-
"seop_ext_class_macros",
|
|
133
|
-
"seop_ext_class_testclasses",
|
|
134
|
-
"seop_incextapp_definition",
|
|
135
|
-
"seop_incextapp_implementation",
|
|
136
|
-
"seop_incextapp_macros",
|
|
137
|
-
"seop_incextapp_testclasses",
|
|
138
|
-
"seos_scotype_exception",
|
|
139
|
-
"seos_scotype_parameter",
|
|
140
|
-
"seox_true",
|
|
141
|
-
"sews_c_vif_version",
|
|
142
|
-
"skwfc_obtype_folder",
|
|
143
|
-
"skwfc_obtype_loio",
|
|
144
|
-
"so2_controller",
|
|
145
|
-
"icon_no_status",
|
|
146
|
-
"icon_package_standard",
|
|
147
|
-
"srext_ext_class_pool",
|
|
148
|
-
"srext_ext_interface_pool",
|
|
149
|
-
"ststc_c_type_dialog",
|
|
150
|
-
"ststc_c_type_object",
|
|
151
|
-
"ststc_c_type_parameters",
|
|
152
|
-
"ststc_c_type_report",
|
|
153
|
-
"swbm_c_op_delete_no_dialog",
|
|
154
|
-
"swbm_c_type_ddic_db_tabxinx",
|
|
155
|
-
"swbm_c_type_wdy_application",
|
|
156
|
-
"swbm_version_active",
|
|
157
|
-
"swbm_version_inactive",
|
|
158
|
-
"wbmr_c_skwf_folder_class",
|
|
159
|
-
"wdyn_limu_component_controller",
|
|
160
|
-
"wdyn_limu_component_definition",
|
|
161
|
-
"wdyn_limu_component_view"
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
"rules": {
|
|
165
|
-
"begin_end_names": true,
|
|
166
|
-
"check_ddic": true,
|
|
167
|
-
"check_include": true,
|
|
168
|
-
"check_syntax": true,
|
|
169
|
-
"global_class": true,
|
|
170
|
-
"implement_methods": true,
|
|
171
|
-
"method_implemented_twice": true,
|
|
172
|
-
"parser_error": true,
|
|
173
|
-
"superclass_final": true,
|
|
174
|
-
"unknown_types": true,
|
|
175
|
-
"xml_consistency": true
|
|
176
|
-
}
|
|
83
|
+
reg.setConfig(new src_1.Config(`
|
|
84
|
+
{
|
|
85
|
+
"global": {
|
|
86
|
+
"files": "/src/**/*.*"
|
|
87
|
+
},
|
|
88
|
+
"dependencies": [],
|
|
89
|
+
"syntax": {
|
|
90
|
+
"version": "v702",
|
|
91
|
+
"errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)",
|
|
92
|
+
"globalConstants": [
|
|
93
|
+
"abap_func_exporting",
|
|
94
|
+
"abap_func_tables",
|
|
95
|
+
"cssf_formtype_text",
|
|
96
|
+
"icon_abap",
|
|
97
|
+
"icon_adopt",
|
|
98
|
+
"icon_change",
|
|
99
|
+
"icon_create",
|
|
100
|
+
"icon_delete",
|
|
101
|
+
"icon_display_text",
|
|
102
|
+
"icon_folder",
|
|
103
|
+
"icon_led_green",
|
|
104
|
+
"icon_led_inactive",
|
|
105
|
+
"icon_led_red",
|
|
106
|
+
"icon_led_yellow",
|
|
107
|
+
"icon_message_information",
|
|
108
|
+
"icon_okay",
|
|
109
|
+
"icon_set_state",
|
|
110
|
+
"icon_stack",
|
|
111
|
+
"icon_system_help",
|
|
112
|
+
"icon_workflow_fork",
|
|
113
|
+
"seoc_category_exception",
|
|
114
|
+
"seoc_category_webdynpro_class",
|
|
115
|
+
"seoc_exposure_private",
|
|
116
|
+
"seoc_exposure_protected",
|
|
117
|
+
"seoc_exposure_public",
|
|
118
|
+
"seoc_state_implemented",
|
|
119
|
+
"seoc_version_active",
|
|
120
|
+
"seoc_version_deleted",
|
|
121
|
+
"seoc_version_inactive",
|
|
122
|
+
"seok_access_free",
|
|
123
|
+
"seok_access_modify",
|
|
124
|
+
"seox_false",
|
|
125
|
+
"seok_pgmid_r3tr",
|
|
126
|
+
"seoo_cmptype_type",
|
|
127
|
+
"seoo_cmptype_event",
|
|
128
|
+
"seoo_cmptype_method",
|
|
129
|
+
"seoo_cmptype_attribute",
|
|
130
|
+
"seop_ext_class_locals_def",
|
|
131
|
+
"seop_ext_class_locals_imp",
|
|
132
|
+
"seop_ext_class_macros",
|
|
133
|
+
"seop_ext_class_testclasses",
|
|
134
|
+
"seop_incextapp_definition",
|
|
135
|
+
"seop_incextapp_implementation",
|
|
136
|
+
"seop_incextapp_macros",
|
|
137
|
+
"seop_incextapp_testclasses",
|
|
138
|
+
"seos_scotype_exception",
|
|
139
|
+
"seos_scotype_parameter",
|
|
140
|
+
"seox_true",
|
|
141
|
+
"sews_c_vif_version",
|
|
142
|
+
"skwfc_obtype_folder",
|
|
143
|
+
"skwfc_obtype_loio",
|
|
144
|
+
"so2_controller",
|
|
145
|
+
"icon_no_status",
|
|
146
|
+
"icon_package_standard",
|
|
147
|
+
"srext_ext_class_pool",
|
|
148
|
+
"srext_ext_interface_pool",
|
|
149
|
+
"ststc_c_type_dialog",
|
|
150
|
+
"ststc_c_type_object",
|
|
151
|
+
"ststc_c_type_parameters",
|
|
152
|
+
"ststc_c_type_report",
|
|
153
|
+
"swbm_c_op_delete_no_dialog",
|
|
154
|
+
"swbm_c_type_ddic_db_tabxinx",
|
|
155
|
+
"swbm_c_type_wdy_application",
|
|
156
|
+
"swbm_version_active",
|
|
157
|
+
"swbm_version_inactive",
|
|
158
|
+
"wbmr_c_skwf_folder_class",
|
|
159
|
+
"wdyn_limu_component_controller",
|
|
160
|
+
"wdyn_limu_component_definition",
|
|
161
|
+
"wdyn_limu_component_view"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"rules": {
|
|
165
|
+
"begin_end_names": true,
|
|
166
|
+
"check_ddic": true,
|
|
167
|
+
"check_include": true,
|
|
168
|
+
"check_syntax": true,
|
|
169
|
+
"global_class": true,
|
|
170
|
+
"implement_methods": true,
|
|
171
|
+
"method_implemented_twice": true,
|
|
172
|
+
"parser_error": true,
|
|
173
|
+
"superclass_final": true,
|
|
174
|
+
"unknown_types": true,
|
|
175
|
+
"xml_consistency": true
|
|
176
|
+
}
|
|
177
177
|
}`));
|
|
178
178
|
reg.parse();
|
|
179
179
|
console.log("run syntax logic,");
|
|
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
class RaiseWith extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
const wit = (0, combi_1.seq)("WITH", _1.
|
|
8
|
+
const wit = (0, combi_1.seq)("WITH", _1.SimpleSource3, (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3));
|
|
9
9
|
return wit;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -5,7 +5,7 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const source_1 = require("./source");
|
|
6
6
|
class RaiseWith {
|
|
7
7
|
runSyntax(node, scope, filename) {
|
|
8
|
-
for (const f of node.findDirectExpressions(Expressions.
|
|
8
|
+
for (const f of node.findDirectExpressions(Expressions.SimpleSource3)) {
|
|
9
9
|
new source_1.Source().runSyntax(f, scope, filename);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -6,13 +6,33 @@ const source_1 = require("../expressions/source");
|
|
|
6
6
|
const target_1 = require("../expressions/target");
|
|
7
7
|
const fstarget_1 = require("../expressions/fstarget");
|
|
8
8
|
const component_cond_1 = require("../expressions/component_cond");
|
|
9
|
+
const basic_1 = require("../../types/basic");
|
|
9
10
|
class ModifyInternal {
|
|
10
11
|
runSyntax(node, scope, filename) {
|
|
11
12
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
12
13
|
new source_1.Source().runSyntax(s, scope, filename);
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
// there is only one
|
|
16
|
+
const targetExpression = node.findFirstExpression(Expressions.Target);
|
|
17
|
+
if (targetExpression) {
|
|
18
|
+
// it might be a dynamic target
|
|
19
|
+
const targetType = new target_1.Target().runSyntax(targetExpression, scope, filename);
|
|
20
|
+
if (targetType instanceof basic_1.VoidType
|
|
21
|
+
|| targetType instanceof basic_1.AnyType
|
|
22
|
+
|| targetType instanceof basic_1.UnknownType) {
|
|
23
|
+
// ok
|
|
24
|
+
}
|
|
25
|
+
else if (targetType instanceof basic_1.TableType) {
|
|
26
|
+
if (node.findDirectTokenByText("TABLE")
|
|
27
|
+
&& node.findDirectTokenByText("INDEX")
|
|
28
|
+
&& targetType.isWithHeader() === false) {
|
|
29
|
+
// MODIFY TABLE INDEX
|
|
30
|
+
throw new Error("Table does not have header line");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
throw new Error("Not an internal table");
|
|
35
|
+
}
|
|
16
36
|
}
|
|
17
37
|
const target = node.findDirectExpression(Expressions.FSTarget);
|
|
18
38
|
if (target) {
|
|
@@ -12,6 +12,9 @@ class Parameter {
|
|
|
12
12
|
if (nameToken && nameToken.getStr().length > 8) {
|
|
13
13
|
throw new Error("Parameter name too long, " + nameToken.getStr());
|
|
14
14
|
}
|
|
15
|
+
if (node.findDirectTokenByText("RADIOBUTTON") && node.findDirectTokenByText("LENGTH")) {
|
|
16
|
+
throw new Error("RADIOBUTTON and LENGTH not possible together");
|
|
17
|
+
}
|
|
15
18
|
const bfound = new basic_types_1.BasicTypes(filename, scope).parseType(node);
|
|
16
19
|
if (nameToken && bfound) {
|
|
17
20
|
scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, bfound));
|
|
@@ -84,13 +84,13 @@ class FlowGraph {
|
|
|
84
84
|
this.label = label;
|
|
85
85
|
}
|
|
86
86
|
toDigraph() {
|
|
87
|
-
return `digraph G {
|
|
88
|
-
labelloc="t";
|
|
89
|
-
label="${this.label}";
|
|
90
|
-
graph [fontname = "helvetica"];
|
|
91
|
-
node [fontname = "helvetica", shape="box"];
|
|
92
|
-
edge [fontname = "helvetica"];
|
|
93
|
-
${this.toTextEdges()}
|
|
87
|
+
return `digraph G {
|
|
88
|
+
labelloc="t";
|
|
89
|
+
label="${this.label}";
|
|
90
|
+
graph [fontname = "helvetica"];
|
|
91
|
+
node [fontname = "helvetica", shape="box"];
|
|
92
|
+
edge [fontname = "helvetica"];
|
|
93
|
+
${this.toTextEdges()}
|
|
94
94
|
}`;
|
|
95
95
|
}
|
|
96
96
|
listSources(node) {
|
|
@@ -25,6 +25,32 @@ class ExpressionNode extends _abstract_node_1.AbstractNode {
|
|
|
25
25
|
}
|
|
26
26
|
throw new Error("ExpressionNode, getFirstToken, no children");
|
|
27
27
|
}
|
|
28
|
+
concatTokensWithLinebreaks() {
|
|
29
|
+
let str = "";
|
|
30
|
+
let prev;
|
|
31
|
+
for (const token of this.getTokens()) {
|
|
32
|
+
if (token instanceof tokens_1.Pragma) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (str === "") {
|
|
36
|
+
str = token.getStr();
|
|
37
|
+
}
|
|
38
|
+
else if (prev && prev.getStr().length + prev.getCol() === token.getCol()
|
|
39
|
+
&& prev.getRow() === token.getRow()) {
|
|
40
|
+
str = str + token.getStr();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
if (prev && prev.getRow() !== token.getRow()) {
|
|
44
|
+
str = str + "\n" + token.getStr();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
str = str + " " + token.getStr();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
prev = token;
|
|
51
|
+
}
|
|
52
|
+
return str;
|
|
53
|
+
}
|
|
28
54
|
concatTokens() {
|
|
29
55
|
let str = "";
|
|
30
56
|
let prev;
|
package/build/src/lsp/help.js
CHANGED
|
@@ -19,13 +19,13 @@ class Help {
|
|
|
19
19
|
/////////////////////////////////////////////////
|
|
20
20
|
static dumpABAP(file, reg, textDocument, position) {
|
|
21
21
|
let content = "";
|
|
22
|
-
content = `
|
|
23
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
24
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
25
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
26
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
27
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
28
|
-
<hr>
|
|
22
|
+
content = `
|
|
23
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
24
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
25
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
26
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
27
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
28
|
+
<hr>
|
|
29
29
|
` +
|
|
30
30
|
"<tt>" + textDocument.uri + " (" +
|
|
31
31
|
(position.line + 1) + ", " +
|
package/build/src/registry.js
CHANGED
|
@@ -17,10 +17,10 @@ class SevenBitAscii {
|
|
|
17
17
|
key: "7bit_ascii",
|
|
18
18
|
title: "Check for 7bit ascii",
|
|
19
19
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
20
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
21
|
-
|
|
22
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
23
|
-
|
|
20
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
21
|
+
|
|
22
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
23
|
+
|
|
24
24
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
25
25
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
26
26
|
};
|
|
@@ -28,10 +28,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
28
28
|
key: "abapdoc",
|
|
29
29
|
title: "Check abapdoc",
|
|
30
30
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
31
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
32
|
-
|
|
33
|
-
Plus class and interface definitions.
|
|
34
|
-
|
|
31
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
32
|
+
|
|
33
|
+
Plus class and interface definitions.
|
|
34
|
+
|
|
35
35
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
36
36
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
37
37
|
};
|
|
@@ -22,49 +22,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
22
22
|
key: "align_parameters",
|
|
23
23
|
title: "Align Parameters",
|
|
24
24
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
25
|
-
extendedInformation: `Checks:
|
|
26
|
-
* function module calls
|
|
27
|
-
* method calls
|
|
28
|
-
* VALUE constructors
|
|
29
|
-
* NEW constructors
|
|
30
|
-
* RAISE EXCEPTION statements
|
|
31
|
-
* CREATE OBJECT statements
|
|
32
|
-
* RAISE EVENT statements
|
|
33
|
-
|
|
34
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
35
|
-
|
|
36
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
37
|
-
|
|
38
|
-
If parameters are on the same row, no issues are reported, see
|
|
25
|
+
extendedInformation: `Checks:
|
|
26
|
+
* function module calls
|
|
27
|
+
* method calls
|
|
28
|
+
* VALUE constructors
|
|
29
|
+
* NEW constructors
|
|
30
|
+
* RAISE EXCEPTION statements
|
|
31
|
+
* CREATE OBJECT statements
|
|
32
|
+
* RAISE EVENT statements
|
|
33
|
+
|
|
34
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
35
|
+
|
|
36
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
37
|
+
|
|
38
|
+
If parameters are on the same row, no issues are reported, see
|
|
39
39
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
40
40
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
41
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
42
|
-
EXPORTING
|
|
43
|
-
foo = 2
|
|
44
|
-
parameter = 3.
|
|
45
|
-
|
|
46
|
-
foobar( moo = 1
|
|
47
|
-
param = 1 ).
|
|
48
|
-
|
|
49
|
-
foo = VALUE #(
|
|
50
|
-
foo = bar
|
|
41
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
42
|
+
EXPORTING
|
|
43
|
+
foo = 2
|
|
44
|
+
parameter = 3.
|
|
45
|
+
|
|
46
|
+
foobar( moo = 1
|
|
47
|
+
param = 1 ).
|
|
48
|
+
|
|
49
|
+
foo = VALUE #(
|
|
50
|
+
foo = bar
|
|
51
51
|
moo = 2 ).`,
|
|
52
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53
|
-
EXPORTING
|
|
54
|
-
foo = 2
|
|
55
|
-
parameter = 3.
|
|
56
|
-
|
|
57
|
-
foobar( moo = 1
|
|
58
|
-
param = 1 ).
|
|
59
|
-
|
|
60
|
-
foo = VALUE #(
|
|
61
|
-
foo = bar
|
|
62
|
-
moo = 2 ).
|
|
63
|
-
|
|
64
|
-
DATA(sdf) = VALUE type(
|
|
65
|
-
common_val = 2
|
|
66
|
-
another_common = 5
|
|
67
|
-
( row_value = 4
|
|
52
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53
|
+
EXPORTING
|
|
54
|
+
foo = 2
|
|
55
|
+
parameter = 3.
|
|
56
|
+
|
|
57
|
+
foobar( moo = 1
|
|
58
|
+
param = 1 ).
|
|
59
|
+
|
|
60
|
+
foo = VALUE #(
|
|
61
|
+
foo = bar
|
|
62
|
+
moo = 2 ).
|
|
63
|
+
|
|
64
|
+
DATA(sdf) = VALUE type(
|
|
65
|
+
common_val = 2
|
|
66
|
+
another_common = 5
|
|
67
|
+
( row_value = 4
|
|
68
68
|
value_foo = 5 ) ).`,
|
|
69
69
|
};
|
|
70
70
|
}
|
|
@@ -20,15 +20,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
20
20
|
return {
|
|
21
21
|
key: "ambiguous_statement",
|
|
22
22
|
title: "Check for ambigious statements",
|
|
23
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
24
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
25
|
-
|
|
23
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
24
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
25
|
+
|
|
26
26
|
Only works if the target version is 740sp05 or above`,
|
|
27
27
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
28
|
-
badExample: `DELETE foo FROM bar.
|
|
28
|
+
badExample: `DELETE foo FROM bar.
|
|
29
29
|
MODIFY foo FROM bar.`,
|
|
30
|
-
goodExample: `DELETE foo FROM @bar.
|
|
31
|
-
MODIFY TABLE foo FROM bar.
|
|
30
|
+
goodExample: `DELETE foo FROM @bar.
|
|
31
|
+
MODIFY TABLE foo FROM bar.
|
|
32
32
|
MODIFY zfoo FROM @wa.`,
|
|
33
33
|
};
|
|
34
34
|
}
|