Re: New driver for Text_Highlighter

From: Date: Wed, 10 Nov 2004 21:57:42 +0000
Subject: Re: New driver for Text_Highlighter
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34299@lists.php.net to get a copy of this message
Hello, I have updated the highlighting driver, performance should be a bit better than before, although probably not as fast as Text_Highlighter. Caching would certainly be useful for both. In KATE's syntax files a region can be ended by several different tokens and the current context can return to the nth previous context. An example: <context name="php_onelinecomment"
    attribute="Comment" lineEndContext="#pop">
    <StringDetect
        attribute="Keyword" context="#pop#pop" String="?&gt;" />
</context> A line end ends the current context, the string "?>" returns to the context before that. I don't think this can automatically be mapped to the current algorithm. I also added some more examples and the option to compare the output to the current highlighter at http://planetxml.de/highlighter/index.php. Regards Jörn Horstmann Andrey Demenev wrote:
This is interesting suggestion. I do like the idea of adding KATE syntax definition support to Text_Highlighter, although there are 2 points: 1) You may have noticed from release history that I am trying to improve speed of highlighting. PHP is not the best tool for test processing from speed aspect. Your class was about 2.5 times slower compared to latest version of Text_Highlighter. Would be great if you find a way to make it faster. I did not dive into your code, so I do not have ideas on speeding it up at the moment 2) Support of syntax definition parsing should be added to the generator -- highlighter should only highlight text. I have not examined the KATE files syntax deeply, but from what I have seen, I think a converter can be created to transform those files to native Text_Highlighter format.


« previous php.pear.dev (#34299) next »