Ver. 12: missing space before keyword causes syntax highlight and code content to break

Claus Pedersen

Member³
I have the following code snippet in a program window package:
Code:
CREATE OR REPLACE PACKAGE BODY test IS

  PROCEDURE tester1 IS
  BEGIN
    IF 1=2THEN
      NULL;
    END IF;
  END;

  PROCEDURE tester2 IS
  BEGIN
    IF 1=2THEN
      NULL;
    END IF;
  END;

END;

This is valid PL/SQL code, but because of the missing space between 2 and THEN in the IF statement, PL/SQL Developer can not parse the code.
The code content pane (to the left of the code) becomes empty and PLD says "Unable to perform operation due to errors in source code".

If I add a space in the IF statement in procedure tester2, method tester1 becomes visible in the code content pane (but not tester2). If I place the cursor on the keyword IF in procedure tester1, the END IF in method tester2 (!) is highlighted.

This also goes for the keyword LOOP (FOR i IN 1..10LOOP).

This used to work in version 11. Please fix this ASAP as it makes many of my packages very hard to edit in version 12 (as navigation
and syntax highlight fails).

I using version 12.0.4.1823 (64 bit)
 
Even though the Oracle compiler accepts this, I don't think the syntax is correct. I would recommend adding a space.
 
I agree, it does not look pretty, but if the PL/SQL compiler accepts the syntax, PLD must comply to this. It used to work in version 11.

Syntax like
SQL:
select'xyz'as"Tester",dual.*from dual where dual . dummy='X'and'w'='w'order by dual . dummy
where there are no spaces before and after ' and " and * and = and extra spaces before and after . (dot) is also valid SQL and should be handled by PLD as such.

Again, I agree it is not pretty, but be sure: if the compiler accepts it, a programmer will use it at some point in time and thus PLD should be able to handle it. The PL/SQL compiler defines what is valid PL/SQL syntax, and we can only accept it.
 
Back
Top