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

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Huxton <dev(at)archonet(dot)com>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Minor irritant with comment parsing in a function (SQL)
Date: 2003-10-08 22:00:34
Message-ID: Pine.LNX.4.44.0310082351170.26413-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-10-08 22:44:38 Re: Bug Report
Previous Message Joe Conway 2003-10-08 21:58:13 Re: Bug Report