Remove special treatment of '|' operator, in the spirit of "sane" binary

operators.
This commit is contained in:
Peter Eisentraut 2000-10-29 16:11:33 +00:00
parent 525e1c4436
commit 86f0812520
2 changed files with 3 additions and 17 deletions

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.200 2000/10/28 19:41:00 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.201 2000/10/29 16:11:33 petere Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -381,7 +381,6 @@ static void doNegateFloat(Value *v);
%left '+' '-'
%left '*' '/' '%'
%left '^'
%left '|' /* XXX Should this have such a high priority? */
/* Unary Operators */
%right UMINUS
%left '.'
@ -4195,7 +4194,6 @@ MathOp: '+' { $$ = "+"; }
| '/' { $$ = "/"; }
| '%' { $$ = "%"; }
| '^' { $$ = "^"; }
| '|' { $$ = "|"; }
| '<' { $$ = "<"; }
| '>' { $$ = ">"; }
| '=' { $$ = "="; }
@ -4238,14 +4236,10 @@ a_expr: c_expr
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
| '^' a_expr
{ $$ = makeA_Expr(OP, "^", NULL, $2); }
| '|' a_expr
{ $$ = makeA_Expr(OP, "|", NULL, $2); }
| a_expr '%'
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
| a_expr '^'
{ $$ = makeA_Expr(OP, "^", $1, NULL); }
| a_expr '|'
{ $$ = makeA_Expr(OP, "|", $1, NULL); }
| a_expr '+' a_expr
{ $$ = makeA_Expr(OP, "+", $1, $3); }
| a_expr '-' a_expr
@ -4258,8 +4252,6 @@ a_expr: c_expr
{ $$ = makeA_Expr(OP, "%", $1, $3); }
| a_expr '^' a_expr
{ $$ = makeA_Expr(OP, "^", $1, $3); }
| a_expr '|' a_expr
{ $$ = makeA_Expr(OP, "|", $1, $3); }
| a_expr '<' a_expr
{ $$ = makeA_Expr(OP, "<", $1, $3); }
| a_expr '>' a_expr
@ -4492,14 +4484,10 @@ b_expr: c_expr
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
| '^' b_expr
{ $$ = makeA_Expr(OP, "^", NULL, $2); }
| '|' b_expr
{ $$ = makeA_Expr(OP, "|", NULL, $2); }
| b_expr '%'
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
| b_expr '^'
{ $$ = makeA_Expr(OP, "^", $1, NULL); }
| b_expr '|'
{ $$ = makeA_Expr(OP, "|", $1, NULL); }
| b_expr '+' b_expr
{ $$ = makeA_Expr(OP, "+", $1, $3); }
| b_expr '-' b_expr
@ -4512,8 +4500,6 @@ b_expr: c_expr
{ $$ = makeA_Expr(OP, "%", $1, $3); }
| b_expr '^' b_expr
{ $$ = makeA_Expr(OP, "^", $1, $3); }
| b_expr '|' b_expr
{ $$ = makeA_Expr(OP, "|", $1, $3); }
| b_expr '<' b_expr
{ $$ = makeA_Expr(OP, "<", $1, $3); }
| b_expr '>' b_expr

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.77 2000/09/12 21:07:02 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.78 2000/10/29 16:11:33 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -184,7 +184,7 @@ typecast "::"
* If you change either set, adjust the character lists appearing in the
* rule for "operator"!
*/
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=]
op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=]
operator {op_chars}+