@abaplint/core 2.120.82 → 2.120.84
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 +19 -5
- package/build/src/abap/1_lexer/tokens/abstract_token.js +36 -12
- package/build/src/abap/5_syntax/_current_scope.js +14 -11
- package/build/src/abap/5_syntax/_eml.js +68 -0
- package/build/src/abap/5_syntax/_object_oriented.js +10 -0
- package/build/src/abap/5_syntax/spaghetti_scope.js +67 -9
- package/build/src/abap/5_syntax/statements/message.js +8 -0
- package/build/src/abap/5_syntax/statements/modify_entities.js +2 -0
- package/build/src/abap/5_syntax/statements/raise.js +6 -0
- package/build/src/abap/5_syntax/statements/read_entities.js +2 -0
- package/build/src/abap/5_syntax/syntax.js +2 -2
- package/build/src/bdef/bdef_parser.js +75 -0
- package/build/src/bdef/expressions/bdef_action.js +15 -0
- package/build/src/bdef/expressions/bdef_alias.js +12 -0
- package/build/src/bdef/expressions/bdef_association.js +15 -0
- package/build/src/bdef/expressions/bdef_association_body.js +18 -0
- package/build/src/bdef/expressions/bdef_authorization_context.js +16 -0
- package/build/src/bdef/expressions/bdef_cardinality.js +13 -0
- package/build/src/bdef/expressions/bdef_default_function.js +14 -0
- package/build/src/bdef/expressions/bdef_define_behavior.js +21 -0
- package/build/src/bdef/expressions/bdef_definition.js +12 -0
- package/build/src/bdef/expressions/bdef_determination.js +15 -0
- package/build/src/bdef/expressions/bdef_determine_action.js +15 -0
- package/build/src/bdef/expressions/bdef_event.js +14 -0
- package/build/src/bdef/expressions/bdef_field.js +13 -0
- package/build/src/bdef/expressions/bdef_field_path.js +13 -0
- package/build/src/bdef/expressions/bdef_header.js +15 -0
- package/build/src/bdef/expressions/bdef_hierarchy.js +16 -0
- package/build/src/bdef/expressions/bdef_implementation_in.js +12 -0
- package/build/src/bdef/expressions/bdef_implementation_type.js +19 -0
- package/build/src/bdef/expressions/bdef_key.js +14 -0
- package/build/src/bdef/expressions/bdef_mapping.js +19 -0
- package/build/src/bdef/expressions/bdef_name.js +13 -0
- package/build/src/bdef/expressions/bdef_operation.js +13 -0
- package/build/src/bdef/expressions/bdef_options.js +15 -0
- package/build/src/bdef/expressions/bdef_parameter.js +13 -0
- package/build/src/bdef/expressions/bdef_reference.js +15 -0
- package/build/src/bdef/expressions/bdef_result.js +13 -0
- package/build/src/bdef/expressions/bdef_side_effects.js +25 -0
- package/build/src/bdef/expressions/bdef_string.js +11 -0
- package/build/src/bdef/expressions/bdef_use.js +18 -0
- package/build/src/bdef/expressions/index.js +46 -0
- package/build/src/lsp/dump_scope.js +3 -2
- package/build/src/objects/behavior_definition.js +46 -8
- package/build/src/position.js +4 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/_procedure_analysis.js +366 -4
- package/build/src/rules/bdef_check_syntax.js +88 -0
- package/build/src/rules/bdef_parser_error.js +47 -0
- package/build/src/rules/boolean_flag_via_if.js +1 -8
- package/build/src/rules/cast_via_generic_reference.js +189 -0
- package/build/src/rules/clear_after_declaration.js +8 -7
- package/build/src/rules/clear_before_overwrite.js +179 -0
- package/build/src/rules/constant_condition.js +9 -8
- package/build/src/rules/copy_chain.js +80 -10
- package/build/src/rules/copy_of_initial_variable.js +4 -2
- package/build/src/rules/index.js +4 -0
- package/build/src/rules/single_use_expression_temp.js +544 -40
- package/build/src/rules/unnecessary_copy.js +7 -4
- package/package.json +1 -1
|
@@ -55,14 +55,17 @@ class UnnecessaryCopy {
|
|
|
55
55
|
extendedInformation: `Reports DATA(a) = b. when all of the following hold:
|
|
56
56
|
|
|
57
57
|
* a is a local variable of a METHOD, FORM or FUNCTION, and has exactly one more reference: a read,
|
|
58
|
-
which does not take its address, bind a field symbol to it, or pass it to USING
|
|
58
|
+
which does not take its address, bind a field symbol to it, or pass it to USING or CHANGING
|
|
59
59
|
* b is a plain data object: variable, constant, attribute, or a chain of components and attributes,
|
|
60
60
|
without calls, offsets, table expressions, field symbols or ->*
|
|
61
61
|
* the declaration is executed before the read on every path: the read is in the block of the declaration
|
|
62
62
|
or a nested block, and both are in the same loop
|
|
63
|
-
* b keeps its value from the declaration until the read: for a local b,
|
|
64
|
-
|
|
65
|
-
variables, by value parameters and RETURNING in
|
|
63
|
+
* b keeps its value from the declaration until the read: for a local b, or a pass-by-value or RETURNING
|
|
64
|
+
parameter b of a method or form, no write to it and its address is never taken; for other b, in addition no
|
|
65
|
+
method, function or form call and no write except to local variables, by value parameters and RETURNING in
|
|
66
|
+
between, and in the statement of the read no call before the read. A method called in that statement could
|
|
67
|
+
change b while it reads the parameter that b is passed to by reference, so the read may only be the receiver
|
|
68
|
+
of the call, or the actual parameter of a pass-by-value parameter of the only method called in the statement
|
|
66
69
|
|
|
67
70
|
a has the type of b, so reading b instead does not change any conversion.
|
|
68
71
|
A constant b read in IF, ELSEIF, WHILE, CHECK, CASE or WHEN is not reported, see constant_condition.
|