Error in parsing and syntax highlighting when variable has same name as XML node

Claus Pedersen

Member³
I have the following code:
Code:
CREATE PROCEDURE test IS
  myXml xmltype;
  abc   INT;
  xyz   INT;
BEGIN
  SELECT xmltype (
           '<?xml?>' ||
           xmlElement(name abc, 'test'))
  INTO   myXml
  FROM   dual;
END;

Note, that in the call to xmlElement, abc is the name of the node.

But PLD mistakes it for a variable.

This gives 2 types of error:

1) the variable abc is not reported as "declared but never used" by PLD (but variable xyz is)

2) when the cursor is on abc in the call to xmlElement, the variable abc is highlighted, and vice versa.
 
Update: when the variable abc is refactored and renamed (e.g. into abd), the name of the node abc is also renamed into abd. This is not just an inconvenience, this can lead to faulty behaviour of the generated program code.

Please fix this.
 
Back
Top