Juan Quintela <quint...@redhat.com> writes: > Markus Armbruster <arm...@redhat.com> wrote: >> When the lexer chokes on a stray character, its shows the characters >> until the next structural character in the error message. > > You have a problem > >> It uses a regular expression > > You use regular expresions. > > Now you have two problems. > > Yes, I had to do it.
:) Regular expressions go bad when pushed too far. Lexers are a perfect fit for them. However, the bug I fix here isn't in the lexer proper, it's in "make the error message nice" code. >> to match a non-empty string of non-structural >> characters. Bug: the regular expression treats '"' as structural. >> When the lexer chokes on '"', the match fails, and trips >> must_match()'s assertion. Fix the regular expression. >> >> Fixes: 14c32795024c (qapi: Improve reporting of lexical errors) >> Signed-off-by: Markus Armbruster <arm...@redhat.com> > > Reviewed-by: Juan Quintela <quint...@redhat.com> Thanks!