summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2021-01-13 19:15:56 +1100
committerJed Barber <jjbarber@y7mail.com>2021-01-13 19:15:56 +1100
commitc5f78d029ff16b8ee0f92186c0bfe6304a53d968 (patch)
treebe0dd8c436f0ea22dc4348c32d71ebcf4e831c99 /src
parentea022446ea40844831a7daa3c6e6d9f7d91c01f2 (diff)
Lexer now is sure to slide input arrays to start with 1
Diffstat (limited to 'src')
-rw-r--r--src/packrat-lexers.adb6
-rw-r--r--src/packrat-parsers.ads5
2 files changed, 3 insertions, 8 deletions
diff --git a/src/packrat-lexers.adb b/src/packrat-lexers.adb
index cd81635..b09b6eb 100644
--- a/src/packrat-lexers.adb
+++ b/src/packrat-lexers.adb
@@ -133,7 +133,7 @@ package body Packrat.Lexers is
if not Context.Pass_Forward.Is_Empty then
Real_Input.Replace_Element (Slide (Context.Pass_Forward.Element) & Input);
else
- Real_Input.Replace_Element (Input);
+ Real_Input.Replace_Element (Slide (Input));
end if;
Tidy_Context (Context, Components'Length);
Context.Result_So_Far.Clear;
@@ -165,7 +165,7 @@ package body Packrat.Lexers is
if not Context.Pass_Forward.Is_Empty then
Real_Input.Replace_Element (Slide (Context.Pass_Forward.Element) & Input);
else
- Real_Input.Replace_Element (Input);
+ Real_Input.Replace_Element (Slide (Input));
end if;
Tidy_Context (Context, Components'Length);
Context.Result_So_Far.Clear;
@@ -197,7 +197,7 @@ package body Packrat.Lexers is
begin
Context.Result_So_Far.Clear;
loop
- Real_Input.Replace_Element (Input.all);
+ Real_Input.Replace_Element (Slide (Input.all));
Empty_Input := Real_Input.Element'Length = 0;
if not Context.Pass_Forward.Is_Empty then
Real_Input.Replace_Element
diff --git a/src/packrat-parsers.ads b/src/packrat-parsers.ads
index 1e058dc..7edddb7 100644
--- a/src/packrat-parsers.ads
+++ b/src/packrat-parsers.ads
@@ -468,11 +468,6 @@ package Packrat.Parsers is
private
- -- refactor Finish_Type from Parse_Graphs into Packrat and use here and in Lexers
-
- -- does the lexer handle input that doesn't start from 1 at the beginning?
-
-
package Elem_Holds is new Ada.Containers.Indefinite_Holders
(Element_Type => Traits.Element_Array,
"=" => Traits."=");