Menu

#2381 SQL Highlighting: does not handle nested comments

Bug
closed-invalid
nobody
lexilla (55)
5
2023-03-10
2023-03-08
pryrt
No

According to this SQL site, SQL allows nested /* */ comments. They give an example similar to the following:

DECLARE @Text AS VARCHAR(20);  
GO  
/*   --Outer Block opened 
SELECT @comment = '/*';  --Nested Block opened 

*/ --Nested Block closed 
 SELECT ShouldBeCommentedOut;
GO

*/  --Outer Block Closed
SELECT @@VERSION;  
GO

But when SciTE v5.3.4 (w/ Lexilla 5.2.3) applies SQL syntax highlighting, the SELECT ShouldBeCommentedOut; line, which is still inside the outer block, is not properly still commented out:

originally reported to the Notepad++ forum here, with the example:

/*
/*--- comment ---*/
SELECT . . .
*/

verified it didn't comment right, either, with Notepad++ v8.5 which uses Scintilla 5.3.3 and Lexilla 5.2.2; so I checked SciTE v5.3.4 to make sure it hadn't already been addressed in the latest Scintilla/Lexilla

Discussion

  • Neil Hodgson

    Neil Hodgson - 2023-03-08
    • labels: --> lexilla
    • status: open --> open-invalid
     
  • Neil Hodgson

    Neil Hodgson - 2023-03-08

    Lexer issues should be reported to the Lexilla project at https://github.com/ScintillaOrg/lexilla .

    The referenced documentation is about Microsoft's SQL variant, not standard SQL or Oracle SQL which is the language handled by the sql lexer. Lexilla includes a lexer for Microsoft SQL called mssql which understands nested comments. You should use the mssql lexer.

     

    Last edit: Neil Hodgson 2023-03-08
  • Neil Hodgson

    Neil Hodgson - 2023-03-10
    • status: open-invalid --> closed-invalid
     

Log in to post a comment.