6,686585
Grand MasterGrand Master
6,686585

    Apr 28, 2017#16

    • Selecting first character of block comment changes highlighting of first line of block comment
    • Highlighting of case-insensitive line comment changes on selecting line comment string
    Those two issues are both fixed in public released version 24.00.0.73 of UltraEdit.
    Best regards from an UC/UE/UES for Windows user from Austria

    25
    Basic UserBasic User
    25

      Highlighting after empty alternate block comment and after slash-star-slash

      Oct 16, 2018#17

      Hi Mofi,

      We had discussed alternate block comments extensively in order to display Oracle SQL Hints in different color than general block comments. Following your advice, it worked well until including v25.10 the following way:

      Block Comment On = /*+ Block Comment Off = */ Block Comment On Alt = /* Block Comment Off Alt = */

      Example:

      Code: Select all

      /* normal multiline
      comment */
      SELECT /*+ this_is_an_Oracle_SQL_HINT, different color and italics with my theme */ * from dual, dual d2
      ;
      Issue 1:
      With UltraEdit version 25.20.0.76 slash-star-star-slash in the text (being an alternate block comment) leads to wrong highlighting of next code lines when the definition of "block comment on" begins with same set of characters as "Block Comment On Alt".

      Code: Select all

      /**/ prompt this is normal code, not a comment, highlighted correctly
      prompt this is normal code, after empty alternate or normal block comment, though HIGHLIGHTED AS COMMENT unless '/*+' as block comment AND block comment alt is removed
      My PLSQL.uew begins with:

      Code: Select all

      /L1"Oracle SQL" Nocase Line Comment = -- Line Comment Alt = rem Block Comment On = /*+ Block Comment Off = */ Block Comment On Alt = /* Block Comment Off Alt = */ String Chars = ' DisableMLS File Extensions = SQL
      Issue 2:
      Slash-star-slash i.e. '/*/' (in fact, the last 2 characters) are interpreted by Oracle as the end of block comment.
       
      UltraEdit version 25.20.0.76 highlights text as block comments after block comments ending with '/*/'

      Code: Select all

      /* normal multiline
      comment ending with slash-star-slash  /*/
      prompt this is normal code, though HIGHLIGHTED AS COMMENT
      This was tested with c_cplusplus.uew and with PLSQL.uew that begins with:

      Code: Select all

      /L1"Oracle SQL" Nocase Line Comment Num = 4rem  Line Comment Alt = -- Block Comment On = /* Block Comment Off = */ String Chars = ' DisableMLS File Extensions = SQL TQL PAK PKS PKG FNC VW PRC TRG AWF OOD INS TAB SYN SQS IND
      Can you reproduce these issues?
      Regards from Vienna

      6,686585
      Grand MasterGrand Master
      6,686585

        Oct 16, 2018#18

        Yes, I can reproduce both syntax highlighting issues using private user verification build 25.20.0.96 of UltraEdit as you can see on attached image and also with UEStudio version 18.20.0.16 (release candidate 1 of UES v18.20). Both issues are definitely caused by bugs in syntax highlighting code of UE v25.20 in my point of view. Please report them by email to IDM support as I have done, too.

        The first highlighting issue exists since UE v25.10.0.62, but does not exist with UE v25.10.0.50 or any former version of UltraEdit. The block comment highlighting issue discussed with JavaScript block comment highlighting fails when opening /* starts right after closing in UE v24.20 and v25.00 (fixed) was fixed with UE v25.10.0.50. But I detected another block comment highlighting issue on verification of this fix on having in a C file:

        Code: Select all

        void foo1()
        {
           /* /* This is a block /* /**/*/ comment. */
           for (int i = 0; i < 10; i++) { // whatever }
           /* This is another block comment. */*/// Line comment.
           return;
        }
        
        void foo2()
        {
           /*/* This is a block /*/**/*/ comment. */
           for (int i = 0; i < 10; i++) { // whatever }
           /* This is another block comment. */*/// Line comment.
           return;
        }
        
        C and C++ files are syntax highlighted with block comment definition: Block Comment On = /* Block Comment Off = */ NestBlockComments
        The second function was not correct highlighted with v25.20.0.50, but is correct highlighted with v25.10.0.62 and later versions. But the fix for this nested block comment example causes now the wrong highlighting in the SQL files with /**/.

        The second issue exists with all versions of UltraEdit which I used for verification. The oldest version used by me was 22.20.0.49. Well, if the character sequence /*/ is interpreted as /*/ or as /*/ can be discussed and most likely depends on used parser.

        A parser not supporting nested block comments interprets this character sequence most likely as / at end of a block comment ending with */ and started before with /*.

        A parser supporting nested block comments interprets this character sequence most likely as a nested block comment starting with /* inside a block comment already started with /* with / being the first character of nested block comment.

        In other words in any scripting or programming language it is advisable to avoid a character sequence with block comment on/off strings with no other characters between because it always depends on the parser how such a sequence is interpreted finally.
        wrong_block_comment_highlighting.png (11.76KiB)
        Shows correct (with additional space) and wrong block comment highlighting on the two described use cases.
        Best regards from an UC/UE/UES for Windows user from Austria

        Read more posts (-12 remaining)