8 Jan 2004 16:56
Re: Lexical safety
David PONCE <david.ponce <at> wanadoo.fr>
2004-01-08 15:56:11 GMT
2004-01-08 15:56:11 GMT
Hi Eric, [...] > I also used this feature in senator's extension to hippie expand. > This way if you type: > > funcall(boo > > and hit hippie-expand, the old behavior was to mark everything as > unmatched syntax starting with the function you were in. Bad bad > bad. Now a quick use of the lexical safety macro puts the buffer > into the 'unparseable' state, so all searches use the cache. Once an > element is found as replacement, the buffer reverts to being merely > out of date. Nifty. [...] I encountered a little problem with the senator's extension to hippie expand when semantic-lex throws a lexical error. In some cases the point is not preserved by `semantic-lex-catch-errors' and hippie expand fails to try other completion methods. The following patch seemed to have fixed the issue. However I am not sure it is the right thing to do. What do you think? Can I commit it? David Index: semantic-lex.el =================================================================== RCS file: /cvsroot/cedet/cedet/semantic/semantic-lex.el,v(Continue reading)
For now, analyzers are generated only for token types which have the
`syntax' property set. So existing grammar shouldn't be impacted.
However, I would appreciate your feedback before to check that changes
in.
[As discussed in the "generic lexical analyzers" thread, the `syntax'
property should hold a regexp that matches a buffer substring based on
Emacs syntax classes. That substring (one can see it as an sort of
"anchor" in the buffer) is then refined with lexical elements provided
by the grammar.]
I attached a sample grammar gr-test.wy that you can use to experiment
lexical analyzer generation
Following is a change log.
Enjoy!
David
2004-01-13 David Ponce <david <at> dponce.com>
* semantic/semantic-grammar-wy.el
RSS Feed