Re: Replacing plpgsql's lexer

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Replacing plpgsql's lexer
Дата
Msg-id 19917.1239744771@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Replacing plpgsql's lexer  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Robert Haas wrote:
>> All this sounds good.  As for how to handle := and .., I think making
>> them lex the same way in PL/pgsql and core SQL would be a good thing.

> They don't have any significance in core SQL. What would we do with the 
> lexeme?

It would just fail --- the core grammar will have no production that can
accept it.  Right offhand I think the only difference is that instead of

regression=# select a .. 2;
ERROR:  syntax error at or near "."
LINE 1: select a .. 2;                 ^

you'd see 

regression=# select a .. 2;
ERROR:  syntax error at or near ".."
LINE 1: select a .. 2;                ^

ie it acts like one token not two in the error message.

This solution would become problematic if the core grammar ever had a
meaning for := or .. that required treating them as two tokens (eg,
the grammar allowed this sequence with whitespace between).  I don't
think that's very likely though; and if it did happen we could fix it
with the aforementioned control switch.

> The only thing that makes me nervous about this is that we're very close 
> to Beta. OTOH, this is one area the regression suite should give a 
> fairly good workout to.

Yeah, I'd rather have done it before beta1, but too late.  The other
solution still entails massive changes to the plpgsql lexer, so it
doesn't really look like much lower risk.  AFAICS the practical
alternatives are a reimplementation in beta2, or no fix until 8.5.
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Replacing plpgsql's lexer
Следующее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Yet another regression issue with Fedora-10 + PG 8.4 beta1