diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/packrat-parsers.adb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/packrat-parsers.adb b/src/packrat-parsers.adb index 01c4677..7c89984 100644 --- a/src/packrat-parsers.adb +++ b/src/packrat-parsers.adb @@ -602,12 +602,15 @@ package body Packrat.Parsers is Processed : Result_Sets.Set; begin if Salt.Status = Failure then - Ada.Strings.Unbounded.Append - (Context.Error_String, - Packrat.Errors.Encode (Traits.Label_Enum'Image (Label), Start)); + declare + Error : String := Packrat.Errors.Encode + (Traits.Label_Enum'Image (Label), Start); + begin + if Ada.Strings.Unbounded.Index (Context.Error_String, Error) = 0 then + Ada.Strings.Unbounded.Append (Context.Error_String, Error); + end if; + end; return Salt; - else - Context.Error_String := +""; end if; for R of Salt.Results loop Current := |