Community
    • Login

    UDL and comments

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 517 Views 1 Watching
    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 Offline
      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 Offline
        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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors