]> git.saurik.com Git - bison.git/blobdiff - data/glr.c
glr.c: omit yyresolveLocations when locations are disabled.
[bison.git] / data / glr.c
index 0a4ed469d063db8068802419e67ee986e900f8b7..f22a8f103a5df9cae1f03dbf49a978c1053768b0 100644 (file)
@@ -35,8 +35,8 @@ m4_define_default([b4_stack_depth_init],  [200])
 ## ------------------------ ##
 
 b4_define_flag_if([pure])
 ## ------------------------ ##
 
 b4_define_flag_if([pure])
-# If glr.cc is including this file and thus has already set b4_pure_flag, don't
-# change the value of b4_pure_flag, and don't record a use of api.pure.
+# If glr.cc is including this file and thus has already set b4_pure_flag,
+# do not change the value of b4_pure_flag, and do not record a use of api.pure.
 m4_ifndef([b4_pure_flag],
 [b4_percent_define_default([[api.pure]], [[false]])
  m4_define([b4_pure_flag],
 m4_ifndef([b4_pure_flag],
 [b4_percent_define_default([[api.pure]], [[false]])
  m4_define([b4_pure_flag],
@@ -1757,7 +1757,7 @@ yyreportAmbiguity (yySemanticOption* yyx0,
 
   yyerror (]b4_yyerror_args[YY_("syntax is ambiguous"));
   return yyabort;
 
   yyerror (]b4_yyerror_args[YY_("syntax is ambiguous"));
   return yyabort;
-}
+}]b4_locations_if([[
 
 /** Resolve the locations for each of the YYN1 states in *YYSTACKP,
  *  ending at YYS1.  Has no effect on previously resolved states.
 
 /** Resolve the locations for each of the YYN1 states in *YYSTACKP,
  *  ending at YYS1.  Has no effect on previously resolved states.
@@ -1815,7 +1815,7 @@ yyresolveLocations (yyGLRState* yys1, int yyn1,
          yylloc = yylloc_current;
        }
     }
          yylloc = yylloc_current;
        }
     }
-}
+}]])[
 
 /** Resolve the ambiguity represented in state YYS in *YYSTACKP,
  *  perform the indicated actions, and set the semantic value of YYS.
 
 /** Resolve the ambiguity represented in state YYS in *YYSTACKP,
  *  perform the indicated actions, and set the semantic value of YYS.
@@ -1850,8 +1850,8 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
        {
          switch (yypreference (yybest, yyp))
            {
        {
          switch (yypreference (yybest, yyp))
            {
-           case 0:
-             yyresolveLocations (yys, 1, yystackp]b4_user_args[);
+           case 0:]b4_locations_if([[
+             yyresolveLocations (yys, 1, yystackp]b4_user_args[);]])[
              return yyreportAmbiguity (yybest, yyp]b4_pure_args[);
              break;
            case 1:
              return yyreportAmbiguity (yybest, yyp]b4_pure_args[);
              break;
            case 1: