Community
    • Login

    Continuation in UDL delimiters

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    udl
    4 Posts 2 Posters 526 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.
    • YellowAfterlifeY
      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
        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
          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
            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
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors