Community
    • Login

    Help about prefix and quotes

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 697 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.
    • Pablo Hugo RedaP
      Pablo Hugo Reda
      last edited by

      HI,
      I have two problems with syntaxis coloring for my language:
      I use single quote as prefix and it doesn’t take it, it’s ignored.

      The other problem is the double quote, it works fine when I define a string, but in my language it is possible to use the double quote as part of the names and they are in the middle of a word so it is not a prefix.

      my definition is here
      https://github.com/phreda4/r3/blob/main/r3.xml

      thank’s !

      Lycan ThropeL 1 Reply Last reply Reply Quote 0
      • Lycan ThropeL
        Lycan Thrope @Pablo Hugo Reda
        last edited by Lycan Thrope

        @Pablo-Hugo-Reda ,

        If this is a version of the ‘R’ language (which I don’t know) I’m curious as to why you want the ' in at all. When I did it with my UDL, it became a problem when text written likecan't would trigger a different highlighting scheme, and since there was no closing apostrophe for quite a while, or at all, all the text between that start and the end would stay the same color. Second, if you’re only using the apostrophe as an opening, but with no closing symbol, you don’t need it highlighted. It’s just a text character, whereas if you make it a syntax highlighted character, you need a closing also.

        The only place I think that this might be able to be used is with numbers, in the prefix section like when you want to use the singular prefix or suffix of b or o to represent binary or octal number ranges, respectively. I haven’t done it, but this may be the only place it’s able to be used, successfully, since anywhere else, no matter how you allow nesting of an apostrophe, you end up needing to close it, or else you end up recoloring everything you didn’t intend to.

        I hope this helps, because I can’t use even open and closed apostrophe because using one in a concatenated word, triggers the highlighting uncontrollably.

        Edit: Almost forgot, even using it in the operators section, might do the same wrong thing. You can try it, but have a bunch of written and numerical text code to try it against.

        Pablo Hugo RedaP 1 Reply Last reply Reply Quote 0
        • Pablo Hugo RedaP
          Pablo Hugo Reda @Lycan Thrope
          last edited by

          @Lycan-Thrope Thanks.
          r3 is not a version of R, is a ColorForth like lang. Prefixes indicate characteristics of words, 'word is the address of word (without close) and I need this words be indicated by other color.

          EkopalypseE 1 Reply Last reply Reply Quote 0
          • EkopalypseE
            Ekopalypse @Pablo Hugo Reda
            last edited by

            @Pablo-Hugo-Reda said in Help about prefix and quotes:

            'word

            I’m afraid you’ve probably reached the limits of UDL. A possible workaround might be to use something like my EnhanceAnyLexer plugin but if your language can create dlls, you could write a lexer plugin instead.

            Pablo Hugo RedaP 1 Reply Last reply Reply Quote 2
            • Pablo Hugo RedaP
              Pablo Hugo Reda @Ekopalypse
              last edited by

              @Ekopalypse Thank’s !!

              1 Reply Last reply Reply Quote 2
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors