[Lazarus] Regex and Syntax Highlighting

Graeme Geldenhuys graemeg.lists at gmail.com
Wed May 26 13:06:59 CEST 2010


2010/5/26 Zaher Dirkey :
>
> I meant the mechanism of SynEdit not SynEdit it self, Let us call "Line
> Feeding Highlighting", LFH if you like :P
> RegEx used on whale file in memory, but that LFH do it line by line, you can
> generate the colored and syntax online without load it in memory, just line
> by line.
> SynEdit use that way the LFH one.

I doubt SynEdit only uses a line by line method. What happens when a
comment block covers multiple lines. The syntax highlighter needs to
keep track of when the comment block started and continue marking
everything as a comment until it finds the matching closing comment
block tag.


Like I said in my first post, I don't know how they currently
integrate regex with a syntax highlighter - that's the whole point of
the exercise, to find out how. You can very easily run a regex on a
line by line basis, but I doubt that is the best way of doing it,
because it will also produce problems with things like comment blocks.


> http://www.hvge.sk/scripts/fshl/
> http://code.google.com/p/fshl/

More links to read, thanks. :)


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/




More information about the Lazarus mailing list