• Login
Community
  • Login

Help about prefix and quotes

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 3 Posters 696 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.
  • P
    Pablo Hugo Reda
    last edited by Jan 1, 2023, 1:21 PM

    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 !

    L 1 Reply Last reply Jan 2, 2023, 1:02 AM Reply Quote 0
    • L
      Lycan Thrope @Pablo Hugo Reda
      last edited by Lycan Thrope Jan 2, 2023, 1:32 AM Jan 2, 2023, 1:02 AM

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

      P 1 Reply Last reply Jan 2, 2023, 3:24 AM Reply Quote 0
      • P
        Pablo Hugo Reda @Lycan Thrope
        last edited by Jan 2, 2023, 3:24 AM

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

        E 1 Reply Last reply Jan 2, 2023, 12:28 PM Reply Quote 0
        • E
          Ekopalypse @Pablo Hugo Reda
          last edited by Jan 2, 2023, 12:28 PM

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

          P 1 Reply Last reply Jan 2, 2023, 3:54 PM Reply Quote 2
          • P
            Pablo Hugo Reda @Ekopalypse
            last edited by Jan 2, 2023, 3:54 PM

            @Ekopalypse Thank’s !!

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