Skip to content

Commit

Permalink
Make parser "on error" behaviour virtual (#330)
Browse files Browse the repository at this point in the history
* Make parser "on error" behaviour virtual

* Added .NET parser change to changelog
  • Loading branch information
Code-Grump authored Dec 16, 2024
1 parent 4e4e082 commit e83fa67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org).
This document is formatted according to the principles of [Keep A CHANGELOG](http://keepachangelog.com).

## [Unreleased]
### Added
- [.NET] Enabled overriding of parser's error-handling

### Fixed
- [c] slight update to existing CMakeFiles.txt to propagate VERSION. Close #320 ([#328](https://github.com/cucumber/gherkin/pull/328))

Expand Down
2 changes: 1 addition & 1 deletion dotnet/Gherkin/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public T Parse(ITokenScanner tokenScanner, ITokenMatcher tokenMatcher)
return GetResult(context);
}

private void AddError(ParserContext context, ParserException error)
protected virtual void AddError(ParserContext context, ParserException error)
{
if (context.Errors.Any(e => e.Message == error.Message))
return;
Expand Down
4 changes: 2 additions & 2 deletions dotnet/gherkin-csharp.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ------------------------------------------------------------------------------
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Berp (http://https://github.com/gasparnagy/berp/).
//
Expand Down Expand Up @@ -122,7 +122,7 @@ namespace @Model.Namespace
return GetResult(context);
}

private void AddError(ParserContext context, ParserException error)
protected virtual void AddError(ParserContext context, ParserException error)
{
if (context.Errors.Any(e => e.Message == error.Message))
return;
Expand Down

0 comments on commit e83fa67

Please sign in to comment.