From 0a68b6a4fe2a9bc77f42055848a90d711a29336d Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Sun, 23 May 2021 18:12:17 -0700 Subject: [PATCH] Copy Name and AddMatch when cloning parsers Fixes #46 --- Eto.Parse/Eto.Parse.csproj | 2 ++ Eto.Parse/Parser.cs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Eto.Parse/Eto.Parse.csproj b/Eto.Parse/Eto.Parse.csproj index 2d492fe..e5d3446 100644 --- a/Eto.Parse/Eto.Parse.csproj +++ b/Eto.Parse/Eto.Parse.csproj @@ -17,6 +17,8 @@ You can use BNF, EBNF, or Gold parser grammars to define your parser, code them Change for v1.6: * Fixed CharSetTerminal.CaseSensitive as it was inverted * Add support for CharRangeTerminal.CaseSensitive +* Clone copies Name and AddMatch properties +* Large character set ranges no longer cause out of memory issues Changes for v1.5: * Add .NET Standard 2.0 target diff --git a/Eto.Parse/Parser.cs b/Eto.Parse/Parser.cs index 7736783..846f828 100644 --- a/Eto.Parse/Parser.cs +++ b/Eto.Parse/Parser.cs @@ -189,7 +189,12 @@ protected Parser() /// Arguments for the copy protected Parser(Parser other, ParserCloneArgs args) { - AddError = other.AddError; + Name = other.Name; + addMatch = other.addMatch; + addMatchSet = other.addMatchSet; + addError = other.addError; + addErrorSet = other.addErrorSet; + args.Add(other, this); }