Compare two lists of PEG grammar rules for equality. Returns Err message if the rules are different, or Ok () if they are the same.
expected - The expected list of rules to compare.actual - The actual list of rules to compare.Result String () - Err message if the rules are different, or Ok () if they are the same.compareRuleLists
[ Sequence [MatchLiteral "a", MatchLiteral "b"]
, Optional (MatchLiteral "c")
, RuleRef "foo"
]
[ Sequence [MatchLiteral "a", MatchLiteral "b"]
, Optional (MatchLiteral "c")
, RuleRef "foo"
]
--> Ok ()
compareRuleLists
[ Sequence [MatchLiteral "a", MatchLiteral "b"]
, Optional (MatchLiteral "c")
, RuleRef "foo"
]
[ Sequence [MatchLiteral "a", MatchLiteral "b"]
, ZeroOrMore (MatchLiteral "c")
, RuleRef "foo"
]
--> Err "expected: Optional (MatchLiteral \"c\"), actual: ZeroOrMore (MatchLiteral \"c\") at position 1"
Compare two PEG grammar rules for equality. Returns
Err messageif the rules are different, orOk ()if they are the same.Arguments
expected- The expected rule to compare.actual- The actual rule to compare.Returns
Result String ()-Err messageif the rules are different, orOk ()if they are the same.Example