[BACK]Return to bc.y CVS log [TXT][DIR] Up to [local] / src / usr.bin / bc

Diff for /src/usr.bin/bc/bc.y between version 1.15 and 1.16

version 1.15, 2003/11/11 09:15:36 version 1.16, 2003/11/11 19:49:02
Line 266 
Line 266 
                                 fflush(stdout);                                  fflush(stdout);
                                 exit(0);                                  exit(0);
                         }                          }
                 | RETURN                  | RETURN return_expression
                         {                          {
                                 if (nesting == 0) {                                  if (nesting == 0) {
                                         warning("return must be in a function");                                          warning("return must be in a function");
                                         YYERROR;                                          YYERROR;
                                 }                                  }
                                 $$ = node(cs("0"), epilogue,                                  $$ = $2;
                                     numnode(nesting), cs("Q"), END_NODE);  
                         }                          }
                 | RETURN LPAR return_expression RPAR  
                         {  
                                 if (nesting == 0) {  
                                         warning("return must be in a function");  
                                         YYERROR;  
                                 }  
                                 $$ = $3;  
                         }  
                 | FOR LPAR alloc_macro opt_expression SEMICOLON                  | FOR LPAR alloc_macro opt_expression SEMICOLON
                      opt_relational_expression SEMICOLON                       opt_relational_expression SEMICOLON
                      opt_expression RPAR opt_statement pop_nesting                       opt_expression RPAR opt_statement pop_nesting
Line 362 
Line 353 
                         }                          }
                 ;                  ;
   
 function        : function_header opt_parameter_list RPAR  function        : function_header opt_parameter_list RPAR opt_newline
                   LBRACE NEWLINE opt_auto_define_list                    LBRACE NEWLINE opt_auto_define_list
                   statement_list RBRACE                    statement_list RBRACE
                         {                          {
                                 int n = node(prologue, $7, epilogue,                                  int n = node(prologue, $8, epilogue,
                                     cs("0"), numnode(nesting),                                      cs("0"), numnode(nesting),
                                     cs("Q"), END_NODE);                                      cs("Q"), END_NODE);
                                 emit_macro($1, n);                                  emit_macro($1, n);
Line 387 
Line 378 
                         }                          }
                 ;                  ;
   
   opt_newline     : /* empty */
                   | NEWLINE
                   ;
   
 opt_parameter_list  opt_parameter_list
                 : /* empty */                  : /* empty */
                 | parameter_list                  | parameter_list
Line 509 
Line 504 
                 | expression                  | expression
                         {                          {
                                 $$ = node($1, epilogue,                                  $$ = node($1, epilogue,
                                       numnode(nesting), cs("Q"), END_NODE);
                           }
                   | LPAR RPAR
                           {
                                   $$ = node(cs("0"), epilogue,
                                     numnode(nesting), cs("Q"), END_NODE);                                      numnode(nesting), cs("Q"), END_NODE);
                         }                          }
                 ;                  ;

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16