• Login
Community
  • Login

UDL and comments

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
2 Posts 2 Posters 268 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    Alan Bourke
    last edited by Sep 13, 2022, 7:51 AM

    Hello again.

    This dialect of BASIC that I am creating a UDL for has three types of comment denoted by:

    REM
    ;
    '
    

    Everything after one of those until EOL is treated as a comment, i.e.

    REM Print a string
    print "hello"
    

    or

    print "hello"  :  rem Print a string
    

    That’s easy enough. The problem is with the single quote which needs to denote a comment but also has another meaning when enclosing a single character (think of it as similar to evaluating to an ASCII code):

    print 'a'   ; This will print 55
    

    It also works with special character sequences in braces:

    print '{white}'    ; This will print 5
    

    I would like to style those cases differently, however it seems to be beyond the scope of the UDL system to handle this, would that be correct ?

    E 1 Reply Last reply Sep 13, 2022, 10:47 AM Reply Quote 0
    • E
      Ekopalypse @Alan Bourke
      last edited by Ekopalypse Sep 13, 2022, 10:48 AM Sep 13, 2022, 10:47 AM

      @Alan-Bourke

      You are right, that is one of the limitations.
      One way around this limitation would be to use the EnhanceAnyLexer plugin, of which I am the author, and define a regex that matches anything within a beginning ' and closing ' character.

      1 Reply Last reply Reply Quote 3
      1 out of 2
      • First post
        1/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors