changeset 2818:cac5a66e48c6

[project @ 1997-03-17 16:54:38 by jwe]
author jwe
date Mon, 17 Mar 1997 16:54:38 +0000
parents 0336f54042df
children ae3cce876a8e
files src/parse.y
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/parse.y	Sun Mar 16 20:09:46 1997 +0000
+++ b/src/parse.y	Mon Mar 17 16:54:38 1997 +0000
@@ -1048,32 +1048,34 @@
 		  }
 		;
 
-in_param_list	: // empty
+param_list_beg	: '('
 		  { lexer_flags.looking_at_parameter_list = 1; }
 		;
 
-param_list	: '(' ')'
+param_list_end	: ')'
+		  { lexer_flags.looking_at_parameter_list = 1; }
+		;
+
+param_list	: param_list_beg param_list_end
 		  {
 		    lexer_flags.quote_is_transpose = 0;
 		    $$ = 0;
 		  }
-		| '(' ELLIPSIS ')'
+		| param_list_beg ELLIPSIS param_list_end
 		  {
 		    lexer_flags.quote_is_transpose = 0;
 		    tree_parameter_list *tmp = new tree_parameter_list ();
 		    tmp->mark_varargs_only ();
 		    $$ = tmp;
 		  }
-		| param_list1 ')'
+		| param_list1 param_list_end
 		  {
-		    lexer_flags.looking_at_parameter_list = 0;
 		    lexer_flags.quote_is_transpose = 0;
 		    $1->mark_as_formal_parameters ();
 		    $$ = $1;
 		  }
-		| param_list1 ',' ELLIPSIS ')'
+		| param_list1 ',' ELLIPSIS param_list_end
 		  {
-		    lexer_flags.looking_at_parameter_list = 0;
 		    lexer_flags.quote_is_transpose = 0;
 		    $1->mark_as_formal_parameters ();
 		    $1->mark_varargs ();
@@ -1081,14 +1083,14 @@
 		  }
 		;
 
-param_list1	: '(' in_param_list identifier
-		  { $$ = new tree_parameter_list ($3); }
+param_list1	: param_list_beg identifier
+		  { $$ = new tree_parameter_list ($2); }
 		| param_list1 ',' identifier
 		  {
 		    $1->append ($3);
 		    $$ = $1;
 		  }
-		| '(' error
+		| param_list_beg error
 		  {
 		    yyerror ("invalid parameter list");
 		    $$ = 0;