ColorizeScript challenge

Geoff Canyon gcanyon at inspiredlogic.com
Thu Apr 27 10:40:57 CDT 2006


On Apr 27, 2006, at 8:31 AM, Richard Gaskin wrote:

> Here's a tough one:  Your script works great in MC (I've had to  
> modify it to use it there, and changed some color assignments while  
> I was at it -- see below), but it doesn't set the color of function  
> names when the function is used in the traditional parenthetic form  
> rather than with "the", e.g.:
>
>   put the length of "Hello" -- colorizes "length"
>   put length("Hello") -- doesn't colorize "length"
>
> I began exploring ways to use token instead of work, but I couldn't  
> do it without changing the actual text.  Maybe with a little more  
> dilligence token might be the magic key we're looking for....

I haven't tried it lately, but in the past my experience using tokens  
has been as useful as words are proving here: useless.

The above is failing of course because my code is looking for a word  
"length" and there is no word "length" in

   put length("Hello")

This brings me back to the suggestion I made a few minutes ago -- the  
only way I see to handle this reliably is character by character.  
Then it would be easy to use spaces, tabs, and parentheses (any  
others?) as delimiters outside strings and comments.

I'm motivated enough to do this tonight, assuming I don't just go to  
sleep -- I was up until 4 last night...


More information about the metacard mailing list