[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
- [PATCH 0/9] glr2.cc: clean up, Akim Demaille, 2020/12/26
- [PATCH 1/9] glr2.cc: don't use YYSTYPE/YYLTYPE at all, Akim Demaille, 2020/12/26
- [PATCH 2/9] glr2.cc: formatting changes, Akim Demaille, 2020/12/26
- [PATCH 3/9] glr2.cc: use YYCDEBUG, not YY_DEBUG_STREAM, Akim Demaille, 2020/12/26
- [PATCH 4/9] glr2.cc: remove dead comments, Akim Demaille, 2020/12/26
- [PATCH 5/9] style: rename semanticVal as value, Akim Demaille, 2020/12/26
- [PATCH 6/9] glr2.cc: pass location by const ref to yyglrShift, Akim Demaille, 2020/12/26
- [PATCH 7/9] style: use yyval only, not yysval, Akim Demaille, 2020/12/26
- [PATCH 8/9] glr2.cc: pass reference to yyreportAmbiguity,
Akim Demaille <=
- [PATCH 9/9] glr2.cc: make yyreportTree a member function of semantic_option, Akim Demaille, 2020/12/26