Patch for removal of RULE bracket use

Started by Bruce Momjianabout 24 years ago3 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

This patch completes the following TODO item:

* Remove brackets as multi-statement rule grouping, must use parens

One question I have is whether this change is needed:

%left '.'
- %left '[' ']'
%left '(' ')'

I believe the logic for removal of brackets for multi-statement rules is
that brackets are just weird in this usage. :-)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/pgpatches/ruletext/plainDownload+18-24
#2Gavin Sherry
swm@linuxworld.com.au
In reply to: Bruce Momjian (#1)
Re: Patch for removal of RULE bracket use

Bruce,

On Thu, 7 Mar 2002, Bruce Momjian wrote:

This patch completes the following TODO item:

* Remove brackets as multi-statement rule grouping, must use parens

One question I have is whether this change is needed:

%left '.'
- %left '[' ']'
%left '(' ')'

It is unncessary to remove this. Square brackets are used elsewhere in the
grammar (arrays, opt_indirection). It is possible that the grammar
requires left to right order of precidence for these.

Gavin

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: Patch for removal of RULE bracket use

Bruce Momjian <pgman@candle.pha.pa.us> writes:

One question I have is whether this change is needed:

%left '.'
- %left '[' ']'
%left '(' ')'

Only if you want to break array-subscript parsing ;-). Leave it in.

I believe the logic for removal of brackets for multi-statement rules is
that brackets are just weird in this usage. :-)

I think the real reason is that psql and other clients aren't smart
about brackets overriding semicolons, and we don't feel like making
them so.

regards, tom lane