bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 8/9] glr2.cc: pass reference to yyreportAmbiguity


From: Akim Demaille
Subject: [PATCH 8/9] glr2.cc: pass reference to yyreportAmbiguity
Date: Sat, 26 Dec 2020 15:42:37 +0100

* data/skeletons/glr2.cc (yyreportAmbiguity): Use references.
---
 data/skeletons/glr2.cc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/data/skeletons/glr2.cc b/data/skeletons/glr2.cc
index a31ad36b..25d66d76 100644
--- a/data/skeletons/glr2.cc
+++ b/data/skeletons/glr2.cc
@@ -1788,8 +1788,8 @@ public:
 #endif
 
   YYRESULTTAG
-  yyreportAmbiguity (semantic_option* yyx0,
-                     semantic_option* yyx1, 
]b4_namespace_ref[::]b4_parser_class[& yyparser]b4_locations_if([, 
location_type *yylocp])[)
+  yyreportAmbiguity (const semantic_option& yyx0,
+                     const semantic_option& yyx1, 
]b4_namespace_ref[::]b4_parser_class[& yyparser]b4_locations_if([, const 
location_type& yyloc])[)
   {
     YYUSE (yyx0);
     YYUSE (yyx1);
@@ -1797,13 +1797,13 @@ public:
 #if ]b4_api_PREFIX[DEBUG
     std::cerr << "Ambiguity detected.\n";
     std::cerr << "Option 1,\n";
-    yyreportTree (*yyx0, 2);
+    yyreportTree (yyx0, 2);
     std::cerr << "\nOption 2,\n";
-    yyreportTree (*yyx1, 2);
+    yyreportTree (yyx1, 2);
     std::cerr << '\n';
 #endif
 
-    yyparser.error (]b4_locations_if([*yylocp, ])[YY_("syntax is ambiguous"));
+    yyparser.error (]b4_locations_if([yyloc, ])[YY_("syntax is ambiguous"));
     return yyabort;
   }
 
@@ -2602,7 +2602,7 @@ private:
               {
               case 0:]b4_locations_if([[
                 yyresolveLocations (yys, 1);]])[
-                return yystateStack.yyreportAmbiguity (yybest, yyp, 
yyparser]b4_locations_if([, yylocp])[);
+                return yystateStack.yyreportAmbiguity (*yybest, *yyp, 
yyparser]b4_locations_if([, *yylocp])[);
                 break;
               case 1:
                 yymerge = true;
-- 
2.29.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]