The syntax_updater tool is a purely syntactical tool so it does not know about locals/arguments/attributes within the body of a routine. If you need to do that, then you need to add code to perform that detection. That is to say lookup the name of the identifier and compare it with either the arguments, locals of the routine, or the object test local if you are under the scope of one.
Note that the parser does not store the name but their ID. So it is sufficient to compare IDs to see if they refer to the same name.
You will find a query called `feature_name’ in ACCESS_FEAT_AS of type ID_AS. From that, you can query `name’. Note that `name’ depends on NAMES_HEAP which is populated during parsing.
The target of the call is represented by the ACCESS_ID_AS node.
This is the nature of the encoding of nested calls. What you need to look at is descendants of CALL_AS. You will see the unqualified variants (descendants of ACCESS_AS), CREATION_EXPR_AS, NESTED_AS and NESTED_EXPR_AS.
So you should process instances of NESTED_AS as well and to perform your processing only once.