I don't really know what you want to do but maybe this helps: http://dean.edwards.name/my/examples/star-light/
(From Alex: Oh, that is sweet.)
Posted by at May 6, 2006 11:26 AMAs Axel said, you can learn from eclipse's syntax highlighting framework. That'll be much easier than trying to reinvent everything from scratch.
Their framework deals with the rehighlight-on-each-keystroke problem, allows writing custom highlighters, and there are some docs about it.
> (Maybe working backwards, from end-of-document to start, may mean not recalculating for offsets and new DOM nodes as iteration continues.)
If you're going a JS route first off (since you have first class functions), you might want to look at PatRat style parsing - here or google for other examples - you can attach the partial functions for the parse state onto the dom nodes in the presentation (these represent the set of possible forward states that have resulted in the complete parse), which should reduce the work on each update event.
Pete
Doesn't Nvu have syntax highlighting?
(From Alex: I believe they do for at least CSS, via CaScadeS v 2, but I don't think that's open-source.)
Posted by Anonymous at May 7, 2006 1:34 AMThere is some syntax highlighting in NVU. Maybe you can start there
Posted by at May 7, 2006 2:47 AM