Skip to content

Commit

Permalink
d: create getter for the number of errors from the parser
Browse files Browse the repository at this point in the history
* data/skeletons/lalr1.d: Here.
  • Loading branch information
adelavais authored and akimd committed Jan 7, 2021
1 parent c13b3c0 commit 8d01c60
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion data/skeletons/lalr1.d
Original file line number Diff line number Diff line change
Expand Up @@ -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>). */
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8d01c60

Please sign in to comment.