Community
    • Login

    UDL and comments

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 262 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.
    • Alan BourkeA
      Alan Bourke
      last edited by

      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 ?

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @Alan Bourke
        last edited by Ekopalypse

        @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
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors