on master help sign in
Merge pull request #482 from tauli/master

SimpleParser: fixed recursive combinators

commiteec1442dfe11fad322990264d5947235c9d54243 authorEdwin Brady <edwin.brady@gmail.com> dateSat 14 Sep 2013, 05:49 (13 years ago) parentb965bd1723437e
1 file changed+2−2
contribs/lib/SimpleParser/SimpleParser.idr+2−2
contribs/lib/SimpleParser/SimpleParser.idr+2−2
@@ -97,7 +97,7 @@ many : Parser a -> Parser (List a)
9797
9898many1 p = [| p :: many p |]
9999
100−many p = many1 p <|> pure []
100+many p = lazy (many1 p) <|> pure []
101101
102102bool : Parser Bool
103103bool = parseTrue <|> parseFalse
@@ -164,7 +164,7 @@ sepBy : Parser a -> Parser b -> Parser (List a)
164164sepBy p s = sepBy1 p s <|> pure Nil
165165
166166manyTil : Parser a -> Parser b -> Parser (List a)
167−manyTil p e = (e $> pure Nil) <|> [| p :: manyTil p e |]
167+manyTil p e = (e $> pure Nil) <|> lazy [| p :: manyTil p e |] <|> pure Nil
168168
169169--------------------------------------------------------------------------------
170170-- Expressions