From 8d01c60e9c1aa5975e38602b8ffeb128833a8518 Mon Sep 17 00:00:00 2001 From: Adela Vais Date: Thu, 7 Jan 2021 14:02:01 +0200 Subject: [PATCH] d: create getter for the number of errors from the parser * 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 bc454205..77d1abe2 100644 --- a/data/skeletons/lalr1.d +++ b/data/skeletons/lalr1.d @@ -304,6 +304,12 @@ b4_user_union_members } /** + * 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 (true). */ public static immutable int YYACCEPT = 0; @@ -434,7 +440,7 @@ b4_user_union_members YYStack yystack; /* Error handling. */ - int yynerrs_ = 0;]b4_locations_if([[ +]b4_locations_if([[ /// The location where the error started. Location yyerrloc; -- 2.11.4.GIT