• Login
Community
  • Login

Continuation in UDL delimiters

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
udl
4 Posts 2 Posters 533 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.
  • Y
    YellowAfterlife
    last edited by Nov 2, 2019, 11:03 AM

    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
    • Y
      YellowAfterlife
      last edited by Nov 3, 2019, 1:48 PM

      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.

      E 1 Reply Last reply Nov 3, 2019, 4:56 PM Reply Quote 1
      • E
        Ekopalypse @YellowAfterlife
        last edited by Nov 3, 2019, 4:56 PM

        @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.

        Y 1 Reply Last reply Nov 5, 2019, 5:04 PM Reply Quote 1
        • Y
          YellowAfterlife @Ekopalypse
          last edited by Nov 5, 2019, 5:04 PM

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