From b2bcd79d78276289fab3406280c787277476b357 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sat, 14 Nov 2020 00:35:45 +1100 Subject: Changed No_Loops_Introduced to Loops_Introduced --- src/packrat-parse_graphs.adb | 8 ++++---- src/packrat-parse_graphs.ads | 4 ++-- test/rat_tests-parse_graphs.adb | 10 +++++----- test/rat_tests-parse_graphs.ads | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/packrat-parse_graphs.adb b/src/packrat-parse_graphs.adb index c44500f..ef425d7 100644 --- a/src/packrat-parse_graphs.adb +++ b/src/packrat-parse_graphs.adb @@ -439,7 +439,7 @@ package body Packrat.Parse_Graphs is end Valid_Starts_Finishes; - function No_Loops_Introduced + function Loops_Introduced (Container : in Parse_Graph; Parent : in Finished_Token; Subtokens : in Finished_Token_Array) @@ -461,9 +461,9 @@ package body Packrat.Parse_Graphs is end if; end Looper; begin - return not Container.Contains (Parent.Token) or else - (for all Sub of Subtokens => not Looper (Sub)); - end No_Loops_Introduced; + return Container.Contains (Parent.Token) and then + (for some Sub of Subtokens => Looper (Sub)); + end Loops_Introduced; function Is_Sorted diff --git a/src/packrat-parse_graphs.ads b/src/packrat-parse_graphs.ads index 595c695..fc5861d 100644 --- a/src/packrat-parse_graphs.ads +++ b/src/packrat-parse_graphs.ads @@ -137,7 +137,7 @@ package Packrat.Parse_Graphs is return Boolean with Pre => Subtokens'Length > 0; - function No_Loops_Introduced + function Loops_Introduced (Container : in Parse_Graph; Parent : in Finished_Token; Subtokens : in Finished_Token_Array) @@ -183,7 +183,7 @@ package Packrat.Parse_Graphs is Subtokens : in Finished_Token_Array) with Pre => Subtokens'Length > 0 and Valid_Starts_Finishes (Parent, Subtokens) and - Container.No_Loops_Introduced (Parent, Subtokens); + not Container.Loops_Introduced (Parent, Subtokens); procedure Prune (Container : in out Parse_Graph; diff --git a/test/rat_tests-parse_graphs.adb b/test/rat_tests-parse_graphs.adb index dce8637..1a42ea6 100644 --- a/test/rat_tests-parse_graphs.adb +++ b/test/rat_tests-parse_graphs.adb @@ -278,22 +278,22 @@ package body Rat_Tests.Parse_Graphs is end Valid_Starts_Finishes_Check; - function No_Loops_Introduced_Check + function Loops_Introduced_Check return Test_Result is My_Graph : Graphs.Parse_Graph := Paper_Graph; begin - if My_Graph.No_Loops_Introduced ((Sen_1, 4), (1 => (Sen_1, 4))) or - not My_Graph.No_Loops_Introduced ((Sen_1, 4), (1 => (NP_1, 4))) + if not My_Graph.Loops_Introduced ((Sen_1, 4), (1 => (Sen_1, 4))) or + My_Graph.Loops_Introduced ((Sen_1, 4), (1 => (NP_1, 4))) then return Fail; end if; My_Graph.Connect ((Sen_1, 4), (1 => (NP_1, 4))); - if My_Graph.No_Loops_Introduced ((NP_1, 4), (1 => (Sen_1, 4))) then + if not My_Graph.Loops_Introduced ((NP_1, 4), (1 => (Sen_1, 4))) then return Fail; end if; return Pass; - end No_Loops_Introduced_Check; + end Loops_Introduced_Check; function Is_Sorted_Check diff --git a/test/rat_tests-parse_graphs.ads b/test/rat_tests-parse_graphs.ads index ad2e48d..7323071 100644 --- a/test/rat_tests-parse_graphs.ads +++ b/test/rat_tests-parse_graphs.ads @@ -21,7 +21,7 @@ package Rat_Tests.Parse_Graphs is function Reachable_Check return Test_Result; function All_Reachable_Check return Test_Result; function Valid_Starts_Finishes_Check return Test_Result; - function No_Loops_Introduced_Check return Test_Result; + function Loops_Introduced_Check return Test_Result; function Is_Sorted_Check return Test_Result; function No_Duplicates_Check return Test_Result; @@ -70,7 +70,7 @@ package Rat_Tests.Parse_Graphs is (+"Reachable", Reachable_Check'Access), (+"All_Reachable", All_Reachable_Check'Access), (+"Valid_Starts_Finishes", Valid_Starts_Finishes_Check'Access), - (+"No_Loops_Introduced", No_Loops_Introduced_Check'Access), + (+"Loops_Introduced", Loops_Introduced_Check'Access), (+"Is_Sorted", Is_Sorted_Check'Access), (+"No_Duplicates", No_Duplicates_Check'Access), -- cgit