Nested Comments Faulty

zakko

Member³
PL/SQL-Developer 15.0.2.2054 (64 bit) has issues with nested multi-line comments.

Given the following comments:

Code:
/*
  Lorem ipsum dolor sit amet, consectetur adipiscing elit,
  sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

  /* Ut enim ad minim veniam, quis nostrud exercitation ullamco
  laboris nisi ut aliquip ex ea commodo consequat.
  Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur. */

  Excepteur sint occaecat cupidatat non proident, sunt in culpa
  qui officia deserunt mollit anim id est laborum.
*/

The lines starting at "Excepteur..." would not be commented out in PL/SQL-Developer.
 
Last edited:
When the first /* is encountered, Oracle begins ignoring all subsequent text until it finds the first occurrence of */. Oracle doesn't "see" the second /* as it is within a comment, which Oracle is not syntax parsing. Once the first */ is encountered, Oracle resumes syntax checking. It runs across the second */ and given the parser is not tracking a currently open /*, it throws an error.

Their approach makes logical sense and it is what Oracle documented. You don't have to agree with it, but it's how the language works and so PSD would/should parse the data the same way and not treat the text starting with "Excepteur..." as a comment.
 
Back
Top