Re: Minor irritant with comment parsing in a function (SQL) - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: Minor irritant with comment parsing in a function (SQL)
Date
Msg-id Pine.LNX.4.44.0310082351170.26413-100000@peter.localdomain
Whole thread Raw
In response to Re: Minor irritant with comment parsing in a function (SQL)  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Joe Conway
Date:
Subject: Re: Bug Report
Next
From: Tom Lane
Date:
Subject: Re: Bug Report