Re: PostgreSQL-13.3 parser.y with positional references by named references

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PostgreSQL-13.3 parser.y with positional references by named references
Дата
Msg-id 1344380.1625414307@sss.pgh.pa.us
обсуждение исходный текст
Ответ на PostgreSQL-13.3 parser.y with positional references by named references  (Domingo Alvarez Duarte <mingodad@gmail.com>)
Ответы Re: PostgreSQL-13.3 parser.y with positional references by named references
Список pgsql-hackers
Domingo Alvarez Duarte <mingodad@gmail.com> writes:
> Here https://gist.github.com/mingodad/49291e0e9505522c66fcd3fcea4a939d I 
> posted the postgresql-13.3/src/backend/parser/gram.y with positional 
> references by named references that is supported by bison for some time now.

When is "some time now"?

Currently, we support bison versions back to 1.875.  While we'd be
willing to raise that bar as soon as a good reason to do so comes
along, I'm not sure that getting rid of $N notation is a sufficient
reason.

Indeed, I'd say getting rid of $$ is a strict loss; the changes you
show make actions much more verbose but certainly not any more
readable.  Having a special notation for a rule's output seems to me
like a good thing not a bad one.  The examples of named notation in
the Bison docs don't seem like unconditional wins either; they're not
very concise, and the contortions you're forced into when the same
nonterminal type is used more than once in a rule are just horrid.

I do see the point about it being annoying to update $N references
when a rule is changed.  But this solution has enough downsides that
I'm not sure it's a net win.  Maybe if it were applied selectively,
to just the longer DDL productions, it'd be worth doing?

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Increase value of OUTER_VAR
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: rand48 replacement