From: Gavin Sinclair Date: 2002-09-08T22:58:37+09:00 Subject: Re: SciTE/VIM Syntax highlighting ----- Original Message ----- From: "Neil Hodgson" > Albert Wagner: > > I just spent the last six weeks trying to write an editor using the Ruby > lexer > > from irb to aid in syntax highlighting. So at the moment, I am of the > > opinion that a proper lexer is probably not fast enough to be anything > more > > than an aggravation in syntax highlighting :-) > > Lexing generally requires very little state compared to parsing and so > can be done well incrementally. For an editor, most modifications only > change the contents of one line and you often only need to relex that line. > Longer lexemes like multi-line comments may require more effort but only > when the modification creates a comment start or end or removes a comment > start or end. > > Neil Do you happen to know any good (into-level) web resources on lexing? The current vim indenting rules for Ruby would really benefit from finding the beginning of the current statement (which may be before the current line, of course). I'm not eager to hack a solution ... until I know how it should have been done properly :) Gavin