bison-patches
[Top][All Lists]
Advanced

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

[PATCH for Dlang support] d: create getter for the number of errors from


From: Adela Vais
Subject: [PATCH for Dlang support] d: create getter for the number of errors from the parser
Date: Thu, 7 Jan 2021 14:02:01 +0200

* 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

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