Commit 00c85b44 authored by Bruce Momjian's avatar Bruce Momjian

Allow comment-only lines, and ;;; lines too.

parent d71ef47a
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.106 1999/10/03 23:55:30 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.107 1999/10/05 18:14:31 momjian Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -365,18 +365,27 @@ Oid param_type(int t); /* used in parse_expr.c */ ...@@ -365,18 +365,27 @@ Oid param_type(int t); /* used in parse_expr.c */
%left UNION INTERSECT EXCEPT %left UNION INTERSECT EXCEPT
%% %%
stmtblock: stmtmulti opt_semi /*
* Handle comment-only lines, and ;; SELECT * FROM pg_class ;;;
* psql already handles such cases, but other interfaces don't.
* bjm 1999/10/05
*/
stmtblock: stmtmulti
{ parsetree = $1; } { parsetree = $1; }
; ;
stmtmulti: stmtmulti ';' stmt stmtmulti: stmtmulti ';' stmt
{ $$ = lappend($1, $3); } { if ($3 != (Node *)NIL)
$$ = lappend($1, $3);
else
$$ = $1;
}
| stmt | stmt
{ $$ = lcons($1,NIL); } { if ($1 != (Node *)NIL)
; $$ = lcons($1,NIL);
else
opt_semi: ';' $$ = (Node *)NIL;
| /*EMPTY*/ }
; ;
stmt : AddAttrStmt stmt : AddAttrStmt
...@@ -423,6 +432,8 @@ stmt : AddAttrStmt ...@@ -423,6 +432,8 @@ stmt : AddAttrStmt
| VariableShowStmt | VariableShowStmt
| VariableResetStmt | VariableResetStmt
| ConstraintsSetStmt | ConstraintsSetStmt
| /*EMPTY*/
{ $$ = (Node *)NIL; }
; ;
/***************************************************************************** /*****************************************************************************
......
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