[Lazarus] Regex and Syntax Highlighting

Graeme Geldenhuys graemeg.lists at gmail.com
Thu May 27 14:48:12 CEST 2010


On 27 May 2010 11:42, Hans-Peter Diettrich wrote:
>
>>> Multi-line comments, or even worse: nested comments, require to pre-scan
>>> an
>>> file, before the highlighter can be used.
>>
>> I don't think this is true. I briefly looked at the jEdit code that
>> manages the syntax highlighting, and it doesn't do multiple passes
>> over the file.
>
> I didn't say that parsing has to be done in multiple passes.

My mistake, I took "pre-scan" as one pass and then "highlighting" as
another pass. It seem perfectly possible to use a single pass/scan of
the source code to manage syntax highlighting - as long as state and
context is carried forward when language syntax is detected that could
span multiple lines (like { or (* style comments).


-- 
Regards,
  - Graeme -


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




More information about the Lazarus mailing list