/[bison]/bison/src/scan-gram.l
ViewVC logotype

Diff of /bison/src/scan-gram.l

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.51 by eggert, Tue Dec 24 07:46:49 2002 UTC revision 1.52 by eggert, Mon Dec 30 22:40:52 2002 UTC
# Line 542  splice  (\\[ \f\t\v]*\n)* Line 542  splice  (\\[ \f\t\v]*\n)*
542    "{"|"<"{splice}"%"  STRING_GROW; braces_level++;    "{"|"<"{splice}"%"  STRING_GROW; braces_level++;
543    "%"{splice}">"      STRING_GROW; braces_level--;    "%"{splice}">"      STRING_GROW; braces_level--;
544    "}" {    "}" {
545      STRING_GROW;      bool outer_brace = --braces_level < 0;
546      braces_level--;  
547      if (braces_level < 0)      /* As an undocumented Bison extension, append `;' before the last
548           brace in braced code, so that the user code can omit trailing
549           `;'.  But do not append `;' if emulating Yacc, since Yacc does
550           not append one.
551    
552           FIXME: Bison should warn if a semicolon seems to be necessary
553           here, and should omit the semicolon if it seems unnecessary
554           (e.g., after ';', '{', or '}', each followed by comments or
555           white space).  Such a warning shouldn't depend on --yacc; it
556           should depend on a new --pedantic option, which would cause
557           Bison to warn if it detects an extension to POSIX.  --pedantic
558           should also diagnose other Bison extensions like %yacc.
559           Perhaps there should also be a GCC-style --pedantic-errors
560           option, so that such warnings are diagnosed as errors.  */
561        if (outer_brace && ! yacc_flag)
562          obstack_1grow (&obstack_for_string, ';');
563    
564        obstack_1grow (&obstack_for_string, '}');
565    
566        if (outer_brace)
567        {        {
568          STRING_FINISH;          STRING_FINISH;
569          rule_length++;          rule_length++;

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26