|
Post by nicc on Apr 6, 2015 13:38:16 GMT -5
Hi George
I am trying to colour my digits (yellow, to be precise). I can add a line for each digit (0-9) in the auto file but if I want a value greater than 9 coloured then I have to have a line for EACH value so I would need a line for each value from 0 to somewhere less than infinity. Any chance of avoiding this?
Cheers Nic
|
|
|
Post by George on Apr 6, 2015 13:53:08 GMT -5
Nic: So you want a string of digits to be considered a 'word'. Not directly, but if you do this it will do what you want. - create a SCHEME statement to specify the colors you want used.
- Add 0123456789 to the end of the DELIMS statement in the AUTO file
- Just like all the other DELIM characters, create a WORD item for each of 0 thru 9 specifying the SCHEME number you chose in point 1.
That should do it. (At least it seemed to do it for me)
George
|
|
|
Post by nicc on Apr 7, 2015 4:31:40 GMT -5
Cunning idea, George! Tried it and it works - as I want it.
I really only need it for base 10 values - everything else is a string of hex (or octal or choose your poison!) characters. I do not even require a string consisting entirely of digits to be highlighted as numeric. I want it highlighted as a string i.e. '123' is a string but 123 is a number. The former is highlighted in white, for me, and the latter in yellow (for me). That is what I want and that is what I now have.
Regarding any idea to highlight any numeric base: how are you going to differentiate between e.g. character A and hex digit A? it could be done - look for 'x' before or after the string but - yeuch!
Thanks for the 'fix'! Nic
|
|
|
Post by George on Apr 7, 2015 11:20:58 GMT -5
Robert: Nic: I don't think I'll touch the job of extending this to various number formats. The color parsing routine is built for speed over flexibility. A 'word' is simply a string surrounded by delimiters, which are themselves considered 'words'. We'd need some kind preprocessor for words to peel off and identify strings like 123.45E67 or 0X3456 etc. before doing a word table lookup. Maybe it would be nice, but then so would proper language parsing, multi-line statements/comments etc. The current colorize support is pretty basic, but I think it does 99% of what people expect it to. George
|
|
|
Post by George on Apr 7, 2015 11:43:24 GMT -5
Robert: Sure, another 'nothing better to do' project. ;-))
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 18, 2015 8:27:57 GMT -5
Nice feature. Jonas
|
|