Re: BUG #13832: Syntax errors are extremely unfriendly
От | John McKown |
---|---|
Тема | Re: BUG #13832: Syntax errors are extremely unfriendly |
Дата | |
Msg-id | CAAJSdjgG_YYxBoYV=zbXxvinE-tDWJUhOw+H+FQVJctZ-Tuu1A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #13832: Syntax errors are extremely unfriendly (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: BUG #13832: Syntax errors are extremely unfriendly
|
Список | pgsql-bugs |
On Mon, Dec 28, 2015 at 2:03 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Tim Hutt <tdhutt@gmail.com> writes: > > On 24 Dec 2015 16:11, "Tom Lane" <tgl@sss.pgh.pa.us> wrote: > >> As far as raw syntax errors go, we're pretty much limited by what Biso= n > >> will do; we're unlikely to implement our own parser from scratch just > >> to improve this. We do go to considerable lengths for semantic > errors... > > > Ah OK I guess this is an issue with Bison - theoretically it should be > able > > to say what it expects when it gets an invalid token right? > > You would think. I've experimented with Bison's %error-verbose directive= , > but if anything its results are worse than doing nothing: it seems to > mention only a rather randomly-chosen subset of the possible > continuations. (That seems to be related to their decision to put a > fairly small hard limit on the length of their error messages, but even > allowing for that, what you get seems pretty random.) It's also > depressingly concrete; instead of something useful like "expected a table > name here", you get "expected IDENT or ABORT or ABSOLUTE or (all possible > unreserved keywords...) here", or at least that's what you would get if > not for the aforesaid problem. > > There's been some recent chat in the PG mailing lists about whether we > could extract tab-completion logic from the grammar specification, which > is sort of related to this issue. We've not gotten far with that idea > unfortunately. > > regards, tom lane > =E2=80=8BI don't know what you've looked at for the auto-complete, but I ra= n across this example which uses GNU readline: http://cc.byexamples.com/2008/06/16/gnu-readline-implement-custom-auto-comp= lete/ =E2=80=8B --=20 Computer Science is the only discipline in which we view adding a new wing to a building as being maintenance -- Jim Horning Schrodinger's backup: The condition of any backup is unknown until a restore is attempted. Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be. He's about as useful as a wax frying pan. 10 to the 12th power microphones =3D 1 Megaphone Maranatha! <>< John McKown
В списке pgsql-bugs по дате отправления: