Commit 86f08125 authored by Peter Eisentraut's avatar Peter Eisentraut

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

operators.
parent 525e1c44
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * 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 * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -381,7 +381,6 @@ static void doNegateFloat(Value *v); ...@@ -381,7 +381,6 @@ static void doNegateFloat(Value *v);
%left '+' '-' %left '+' '-'
%left '*' '/' '%' %left '*' '/' '%'
%left '^' %left '^'
%left '|' /* XXX Should this have such a high priority? */
/* Unary Operators */ /* Unary Operators */
%right UMINUS %right UMINUS
%left '.' %left '.'
...@@ -4195,7 +4194,6 @@ MathOp: '+' { $$ = "+"; } ...@@ -4195,7 +4194,6 @@ MathOp: '+' { $$ = "+"; }
| '/' { $$ = "/"; } | '/' { $$ = "/"; }
| '%' { $$ = "%"; } | '%' { $$ = "%"; }
| '^' { $$ = "^"; } | '^' { $$ = "^"; }
| '|' { $$ = "|"; }
| '<' { $$ = "<"; } | '<' { $$ = "<"; }
| '>' { $$ = ">"; } | '>' { $$ = ">"; }
| '=' { $$ = "="; } | '=' { $$ = "="; }
...@@ -4238,14 +4236,10 @@ a_expr: c_expr ...@@ -4238,14 +4236,10 @@ a_expr: c_expr
{ $$ = makeA_Expr(OP, "%", NULL, $2); } { $$ = makeA_Expr(OP, "%", NULL, $2); }
| '^' a_expr | '^' a_expr
{ $$ = makeA_Expr(OP, "^", NULL, $2); } { $$ = makeA_Expr(OP, "^", NULL, $2); }
| '|' a_expr
{ $$ = makeA_Expr(OP, "|", NULL, $2); }
| a_expr '%' | a_expr '%'
{ $$ = makeA_Expr(OP, "%", $1, NULL); } { $$ = makeA_Expr(OP, "%", $1, NULL); }
| a_expr '^' | a_expr '^'
{ $$ = makeA_Expr(OP, "^", $1, NULL); } { $$ = makeA_Expr(OP, "^", $1, NULL); }
| a_expr '|'
{ $$ = makeA_Expr(OP, "|", $1, NULL); }
| a_expr '+' a_expr | a_expr '+' a_expr
{ $$ = makeA_Expr(OP, "+", $1, $3); } { $$ = makeA_Expr(OP, "+", $1, $3); }
| a_expr '-' a_expr | a_expr '-' a_expr
...@@ -4258,8 +4252,6 @@ a_expr: c_expr ...@@ -4258,8 +4252,6 @@ a_expr: c_expr
{ $$ = makeA_Expr(OP, "%", $1, $3); } { $$ = makeA_Expr(OP, "%", $1, $3); }
| a_expr '^' a_expr | a_expr '^' a_expr
{ $$ = makeA_Expr(OP, "^", $1, $3); } { $$ = makeA_Expr(OP, "^", $1, $3); }
| a_expr '|' a_expr
{ $$ = makeA_Expr(OP, "|", $1, $3); }
| a_expr '<' a_expr | a_expr '<' a_expr
{ $$ = makeA_Expr(OP, "<", $1, $3); } { $$ = makeA_Expr(OP, "<", $1, $3); }
| a_expr '>' a_expr | a_expr '>' a_expr
...@@ -4492,14 +4484,10 @@ b_expr: c_expr ...@@ -4492,14 +4484,10 @@ b_expr: c_expr
{ $$ = makeA_Expr(OP, "%", NULL, $2); } { $$ = makeA_Expr(OP, "%", NULL, $2); }
| '^' b_expr | '^' b_expr
{ $$ = makeA_Expr(OP, "^", NULL, $2); } { $$ = makeA_Expr(OP, "^", NULL, $2); }
| '|' b_expr
{ $$ = makeA_Expr(OP, "|", NULL, $2); }
| b_expr '%' | b_expr '%'
{ $$ = makeA_Expr(OP, "%", $1, NULL); } { $$ = makeA_Expr(OP, "%", $1, NULL); }
| b_expr '^' | b_expr '^'
{ $$ = makeA_Expr(OP, "^", $1, NULL); } { $$ = makeA_Expr(OP, "^", $1, NULL); }
| b_expr '|'
{ $$ = makeA_Expr(OP, "|", $1, NULL); }
| b_expr '+' b_expr | b_expr '+' b_expr
{ $$ = makeA_Expr(OP, "+", $1, $3); } { $$ = makeA_Expr(OP, "+", $1, $3); }
| b_expr '-' b_expr | b_expr '-' b_expr
...@@ -4512,8 +4500,6 @@ b_expr: c_expr ...@@ -4512,8 +4500,6 @@ b_expr: c_expr
{ $$ = makeA_Expr(OP, "%", $1, $3); } { $$ = makeA_Expr(OP, "%", $1, $3); }
| b_expr '^' b_expr | b_expr '^' b_expr
{ $$ = makeA_Expr(OP, "^", $1, $3); } { $$ = makeA_Expr(OP, "^", $1, $3); }
| b_expr '|' b_expr
{ $$ = makeA_Expr(OP, "|", $1, $3); }
| b_expr '<' b_expr | b_expr '<' b_expr
{ $$ = makeA_Expr(OP, "<", $1, $3); } { $$ = makeA_Expr(OP, "<", $1, $3); }
| b_expr '>' b_expr | b_expr '>' b_expr
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * 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 "::" ...@@ -184,7 +184,7 @@ typecast "::"
* If you change either set, adjust the character lists appearing in the * If you change either set, adjust the character lists appearing in the
* rule for "operator"! * rule for "operator"!
*/ */
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|] self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=]
op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=] op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=]
operator {op_chars}+ operator {op_chars}+
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment