Re: Minor irritant with comment parsing in a function (SQL)

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Minor irritant with comment parsing in a function (SQL)
Дата
Msg-id Pine.LNX.4.44.0310082351170.26413-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: Minor irritant with comment parsing in a function (SQL)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Tom Lane writes:

> I think the minimum-damage place to fix this is by requiring \n after
> {comment} in the horiz_whitespace rule.  As is, it's possible for
> xqcat to match to a second quote that is in the body of a -- comment.

You mean like this?

horiz_whitespace    ({horiz_space}|{comment}{newline})
whitespace_with_newline    ({horiz_whitespace}*{newline}{whitespace}*)

That doesn't work.  The offending comment in the example is matched to
{whitespace} after {newline} in the second rule.  The {horiz_whitespace}*
is matched to empty.  We could do

special_whitespace    ({space}+|{comment}{newline})
horiz_whitespace    ({horiz_space}|{comment})
whitespace_with_newline    ({horiz_whitespace}*{newline}{special_whitespace}*)

--
Peter Eisentraut   peter_e@gmx.net

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Bug Report
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug Report