Skip to content

Commit e83fa67

Browse files
authored
Make parser "on error" behaviour virtual (#330)
* Make parser "on error" behaviour virtual * Added .NET parser change to changelog
1 parent 4e4e082 commit e83fa67

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org).
77
This document is formatted according to the principles of [Keep A CHANGELOG](http://keepachangelog.com).
88

99
## [Unreleased]
10+
### Added
11+
- [.NET] Enabled overriding of parser's error-handling
12+
1013
### Fixed
1114
- [c] slight update to existing CMakeFiles.txt to propagate VERSION. Close #320 ([#328](https://github.com/cucumber/gherkin/pull/328))
1215

dotnet/Gherkin/Parser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public T Parse(ITokenScanner tokenScanner, ITokenMatcher tokenMatcher)
131131
return GetResult(context);
132132
}
133133

134-
private void AddError(ParserContext context, ParserException error)
134+
protected virtual void AddError(ParserContext context, ParserException error)
135135
{
136136
if (context.Errors.Any(e => e.Message == error.Message))
137137
return;

dotnet/gherkin-csharp.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ------------------------------------------------------------------------------
1+
// ------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by Berp (http://https://github.com/gasparnagy/berp/).
44
//
@@ -122,7 +122,7 @@ namespace @Model.Namespace
122122
return GetResult(context);
123123
}
124124

125-
private void AddError(ParserContext context, ParserException error)
125+
protected virtual void AddError(ParserContext context, ParserException error)
126126
{
127127
if (context.Errors.Any(e => e.Message == error.Message))
128128
return;

0 commit comments

Comments
 (0)