From: Tom Lane Date: Wed, 26 Sep 2001 21:35:28 +0000 (+0000) Subject: The trailing semicolon in a plpgsql function definition is now optional. X-Git-Tag: REL7_2_BETA1~312 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cdd914686394de4c88464a4385b36d8106f8401e;p=postgresql The trailing semicolon in a plpgsql function definition is now optional. Per gripe 9/26. --- diff --git a/src/pl/plpgsql/src/gram.y b/src/pl/plpgsql/src/gram.y index 62e26f9006..ad45bd2d49 100644 --- a/src/pl/plpgsql/src/gram.y +++ b/src/pl/plpgsql/src/gram.y @@ -4,7 +4,7 @@ * procedural language * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.24 2001/07/12 17:42:07 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.25 2001/09/26 21:35:28 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -210,11 +210,11 @@ static PLpgSQL_expr *make_tupret_expr(PLpgSQL_row *row); %% -pl_function : T_FUNCTION comp_optsect pl_block +pl_function : T_FUNCTION comp_optsect pl_block opt_semi { yylval.program = (PLpgSQL_stmt_block *)$3; } - | T_TRIGGER comp_optsect pl_block + | T_TRIGGER comp_optsect pl_block opt_semi { yylval.program = (PLpgSQL_stmt_block *)$3; } @@ -234,7 +234,11 @@ comp_option : O_OPTION O_DUMP } ; -pl_block : decl_sect K_BEGIN lno proc_sect K_END ';' +opt_semi : + | ';' + ; + +pl_block : decl_sect K_BEGIN lno proc_sect K_END { PLpgSQL_stmt_block *new; @@ -704,7 +708,7 @@ proc_stmts : proc_stmts proc_stmt } ; -proc_stmt : pl_block +proc_stmt : pl_block ';' { $$ = $1; } | stmt_assign { $$ = $1; }