Commit 0aff9293 authored by Peter Eisentraut's avatar Peter Eisentraut

Use grammar symbol function_with_argtypes consistently

Instead of sometimes referring to a function signature like func_name
func_args, use the existing function_with_argtypes symbol, which
combines the two.
Reviewed-by: default avatarAlvaro Herrera <alvherre@2ndquadrant.com>
Reviewed-by: default avatarTom Lane <tgl@sss.pgh.pa.us>
parent 11003eb5
...@@ -5414,21 +5414,21 @@ opclass_item: ...@@ -5414,21 +5414,21 @@ opclass_item:
n->order_family = $5; n->order_family = $5;
$$ = (Node *) n; $$ = (Node *) n;
} }
| FUNCTION Iconst func_name func_args | FUNCTION Iconst function_with_argtypes
{ {
CreateOpClassItem *n = makeNode(CreateOpClassItem); CreateOpClassItem *n = makeNode(CreateOpClassItem);
n->itemtype = OPCLASS_ITEM_FUNCTION; n->itemtype = OPCLASS_ITEM_FUNCTION;
n->name = $3; n->name = $3->funcname;
n->args = extractArgTypes($4); n->args = $3->funcargs;
n->number = $2; n->number = $2;
$$ = (Node *) n; $$ = (Node *) n;
} }
| FUNCTION Iconst '(' type_list ')' func_name func_args | FUNCTION Iconst '(' type_list ')' function_with_argtypes
{ {
CreateOpClassItem *n = makeNode(CreateOpClassItem); CreateOpClassItem *n = makeNode(CreateOpClassItem);
n->itemtype = OPCLASS_ITEM_FUNCTION; n->itemtype = OPCLASS_ITEM_FUNCTION;
n->name = $6; n->name = $6->funcname;
n->args = extractArgTypes($7); n->args = $6->funcargs;
n->number = $2; n->number = $2;
n->class_args = $4; n->class_args = $4;
$$ = (Node *) n; $$ = (Node *) n;
...@@ -5828,13 +5828,13 @@ CommentStmt: ...@@ -5828,13 +5828,13 @@ CommentStmt:
n->comment = $7; n->comment = $7;
$$ = (Node *) n; $$ = (Node *) n;
} }
| COMMENT ON FUNCTION func_name func_args IS comment_text | COMMENT ON FUNCTION function_with_argtypes IS comment_text
{ {
CommentStmt *n = makeNode(CommentStmt); CommentStmt *n = makeNode(CommentStmt);
n->objtype = OBJECT_FUNCTION; n->objtype = OBJECT_FUNCTION;
n->objname = $4; n->objname = $4->funcname;
n->objargs = extractArgTypes($5); n->objargs = $4->funcargs;
n->comment = $7; n->comment = $6;
$$ = (Node *) n; $$ = (Node *) n;
} }
| COMMENT ON OPERATOR any_operator oper_argtypes IS comment_text | COMMENT ON OPERATOR any_operator oper_argtypes IS comment_text
...@@ -6046,15 +6046,15 @@ SecLabelStmt: ...@@ -6046,15 +6046,15 @@ SecLabelStmt:
n->label = $9; n->label = $9;
$$ = (Node *) n; $$ = (Node *) n;
} }
| SECURITY LABEL opt_provider ON FUNCTION func_name func_args | SECURITY LABEL opt_provider ON FUNCTION function_with_argtypes
IS security_label IS security_label
{ {
SecLabelStmt *n = makeNode(SecLabelStmt); SecLabelStmt *n = makeNode(SecLabelStmt);
n->provider = $3; n->provider = $3;
n->objtype = OBJECT_FUNCTION; n->objtype = OBJECT_FUNCTION;
n->objname = $6; n->objname = $6->funcname;
n->objargs = extractArgTypes($7); n->objargs = $6->funcargs;
n->label = $9; n->label = $8;
$$ = (Node *) n; $$ = (Node *) n;
} }
| SECURITY LABEL opt_provider ON LARGE_P OBJECT_P NumericOnly | SECURITY LABEL opt_provider ON LARGE_P OBJECT_P NumericOnly
...@@ -7284,24 +7284,24 @@ opt_restrict: ...@@ -7284,24 +7284,24 @@ opt_restrict:
*****************************************************************************/ *****************************************************************************/
RemoveFuncStmt: RemoveFuncStmt:
DROP FUNCTION func_name func_args opt_drop_behavior DROP FUNCTION function_with_argtypes opt_drop_behavior
{ {
DropStmt *n = makeNode(DropStmt); DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_FUNCTION; n->removeType = OBJECT_FUNCTION;
n->objects = list_make1($3); n->objects = list_make1($3->funcname);
n->arguments = list_make1(extractArgTypes($4)); n->arguments = list_make1($3->funcargs);
n->behavior = $5; n->behavior = $4;
n->missing_ok = false; n->missing_ok = false;
n->concurrent = false; n->concurrent = false;
$$ = (Node *)n; $$ = (Node *)n;
} }
| DROP FUNCTION IF_P EXISTS func_name func_args opt_drop_behavior | DROP FUNCTION IF_P EXISTS function_with_argtypes opt_drop_behavior
{ {
DropStmt *n = makeNode(DropStmt); DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_FUNCTION; n->removeType = OBJECT_FUNCTION;
n->objects = list_make1($5); n->objects = list_make1($5->funcname);
n->arguments = list_make1(extractArgTypes($6)); n->arguments = list_make1($5->funcargs);
n->behavior = $7; n->behavior = $6;
n->missing_ok = true; n->missing_ok = true;
n->concurrent = false; n->concurrent = false;
$$ = (Node *)n; $$ = (Node *)n;
......
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