Re: on-the-fly syntax highlighter
| From: | Gabor Hojtsy | Date: | Sun, 12 Jan 2003 16:34:12 +0000 |
| Subject: | Re: on-the-fly syntax highlighter | ||
| References: | 1 2 3 | Groups: | php.doc.chm |
| Request: | Send a blank email to php-doc-chm+get-601@lists.php.net to get a copy of this message | ||
> echo "$key = $val\n";
>
> In the current php syntax highlighter that is in chm file, the $key would
> not be blue, however in echo statements a lot of things are colored other
> colors. (check it out.. open your chm file and take a look)
>
> It would be very possible to make this happen but not without a noticeable
> drop in rendering time. The syntax highlighter works by finding a start
and
> end point of strings, and then highlighting them. Because just about
> anything can come after a var, e.g. <>!@#$%^&*()-=+;'[]\:"{}|?, one search
> would have to take place for each of these characters. That is a lot of
> searches!
Maybe another search to find the endpoint with specifying what is valid
before the endpoint. It is quite easier to specify what is a valid
varname char...
BTW have you looked at JS regular expression support? It may also help
in such cases (and maybe in others too) to speed up the parsing.
Goba