On Monday, 11 June 2012 at 17:41:12 UTC, Rainer Schuetze wrote:
No. Syntax highlighting is done by the lexer, no (complex) parsing involved. The only case where the parser is consulted (but not waiting for an answer, just using cached information) is to figure out whether "in"/"is" are used as operators or as parameter modifier/IsExpression, respectively.

Syntax highlighting needs to be rather fast, as it is done during drawing, so switching context is out of the question. Instead, Visual D keeps a lexer-state (an int) per line and continues scanning from the start of the line when color information is requested by the IDE.
I couldn't find respective code so far

Reply via email to