* data/skeletons/lalr1.d: Here.
---
 data/skeletons/lalr1.d | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/data/skeletons/lalr1.d b/data/skeletons/lalr1.d
index e97613b6..d97d1f2a 100644
--- a/data/skeletons/lalr1.d
+++ b/data/skeletons/lalr1.d
@@ -303,6 +303,12 @@ b4_user_union_members
     yylexer.yyerror (]b4_locations_if([loc, ])[s);
   }
 
+  /**
+   * The number of syntax errors so far.
+   */
+  public int numberOfErrors() const { return yynerrs_; }
+  private int yynerrs_ = 0;
+
   /**
    * Returned by a Bison action in order to stop the parsing process and
    * return success (<tt>true</tt>).  */
@@ -437,7 +443,7 @@ b4_locations_if([, ref Location yylocationp])[)
     YYStack yystack;
 
     /* Error handling.  */
-    int yynerrs_ = 0;]b4_locations_if([[
+]b4_locations_if([[
     /// The location where the error started.
     Location yyerrloc;
 
-- 
2.17.1


Reply via email to