Help about prefix and quotes
-
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.xmlthank’s !
-
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
oro
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.
-
@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. -
@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.
-
@Ekopalypse Thank’s !!