summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2020-12-25 22:13:59 +1100
committerJed Barber <jjbarber@y7mail.com>2020-12-25 22:13:59 +1100
commitdd9121ec8d91784e6cea4e71cd1fe5c3735d81d8 (patch)
treeb8447cdadc2adc5026a78a4240e3e111f9423999 /src
parent9d5eccf7d6662e897eaa1b6b5f16fba0aa5a5f38 (diff)
Parser tests, left recursion test
Diffstat (limited to 'src')
-rw-r--r--src/packrat-parsers.adb13
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 :=