Community
    • Login

    Continuation in UDL delimiters

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    udl
    4 Posts 2 Posters 936 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.
    • YellowAfterlifeY Offline
      YellowAfterlife
      last edited by

      Suppose you have a UDL for a language resembling C++, which allows continuation in comments, strings, and specific preprocessor statements. The comment part is easily implemented, as there is a separate “continue” field. String/preprocessors aren’t, however.

      This is what I’m trying accomplish (shown: built-in C highlighter)
      42bd3b73-d83b-4584-b7de-6f6472d1c2f4-image.png

      This is what I get so far (magenta is the default style)
      9c0ed658-4c15-4892-83b8-8429de5634d1-image.png

      For strings, I can kind of make it work by omitting the EOL in Close (with obvious side effects being that unclosed strings eat the rest of the file) or swapping them with comments (since you are less likely to want a continued comment), but not for preprocessors - at most I can make #define a separate keyword, but then # can’t be an operator (since it’ll take precedence over #define) and I have to add a bunch of operators covering various valid adjacency options for #.

      (NPP v.7.8 / UDL v.2.1.0.12)

      1 Reply Last reply Reply Quote 0
      • YellowAfterlifeY Offline
        YellowAfterlife
        last edited by

        To those whom it might concern, it turned out that using comment as a string means that escape characters don’t work, so I gave up on this and went for delimiter-without-EOL-close + keyword combination.

        EkopalypseE 1 Reply Last reply Reply Quote 1
        • EkopalypseE Offline
          Ekopalypse @YellowAfterlife
          last edited by

          @YellowAfterlife

          one other step you can do to overcome the UDL limitation is to
          use an scripting language plugin like pythonscript and a script
          like discussed here.

          YellowAfterlifeY 1 Reply Last reply Reply Quote 1
          • YellowAfterlifeY Offline
            YellowAfterlife @Ekopalypse
            last edited by

            @Ekopalypse said in Continuation in UDL delimiters:

            @YellowAfterlife

            one other step you can do to overcome the UDL limitation is to
            use an scripting language plugin like pythonscript and a script
            like discussed here.

            That’s pretty cool! I didn’t realize that plugins were allowed to touch Scintilla. Maybe I’d be able to write a native plugin directly if documentation proves sufficient and I find time to do so.

            1 Reply Last reply Reply Quote 1

            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