[Lazarus] Regex and Syntax Highlighting

Zaher Dirkey parmaja at gmail.com
Tue May 25 20:08:46 CEST 2010


I beleave regex is not a good choice.
If you compare the speed you will find SynEdit is more faster.
I import it to make my syntax for my site using PHP i found my Highlighter
is more faster (10 time) than the famous one (Geshi) that use the regex.

http://www.parmaja.com/forums/viewtopic.php?id=45
http://qbnz.com/highlighter/

On Tue, May 25, 2010 at 4:14 PM, Graeme Geldenhuys
<graemeg.lists at gmail.com>wrote:

> On 25 May 2010 14:38, Marco van de Voort wrote:
> >
> > But the main problem IMHO is that regex is not suited to highlight many
> > languages that require correct detection of matching tokens, like the
> Pascal
> > nested comments.
>
> mcedit (editor part of Midnight Commander) supports 68 different file
> formats by default. That alone is already very impressive.
>
> gEdit supports 85 different file formats by default (included in
> Ubuntu 10.04). Even more impressive than mcedit.
>
>
> In both cases, I simply had to tweak one or two lines of the pascal
> syntax definition files to get the Object Pascal syntax correct for
> Free Pascal specific features I use and for my code. So this is
> clearly not so much of a problem and regex is sufficiently flexible
> for most (if not all) languages.
>
> I don't want to make this a debate if regex is a good choice or not. I
> am going to use regex no matter what others say, I simply need to find
> out more information on how to tie it into a editor component and what
> is required from the editor component. I'll download the code for the
> gtksourceview component (what is used in gEdit) and see if that gives
> me some hints.
>
> Thinking about it, I should also take a look at Sun's Java code. I
> quite like their Document interface and how flexible it is to use...
> even for something as simple as a TEdit and to as complex as a
> full-blown programming editor or WYSIWYG editor.
>
> --
> Regards,
>  - Graeme -
>
>
> _______________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://opensoft.homeip.net/fpgui/
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100525/3f12048f/attachment-0004.html>


More information about the Lazarus mailing list