mooie seplist
[cc1516.git] / parse.icl
index a6374c1..ebfc7a0 100644 (file)
--- a/parse.icl
+++ b/parse.icl
@@ -243,10 +243,9 @@ tokEq (StringToken _) (StringToken _) = True
 tokEq x y = gEq {|*|} x y
 
 parseSepList :: TokenValue (Parser Token a) -> Parser Token [a]
-parseSepList sep p = 
-    (p <* satTok sep >>= \v1-> parseSepList sep p >>= \vs -> pure [v1:vs])
-        <|> (p >>= \v-> pure [v])
-        <|> pure []
+parseSepList sep p = pSL` sep p <|> pure []
+       where 
+               pSL` sep p = (p <* satTok sep >>= \v1->parseSepList sep p >>= \vs->pure [v1:vs]) <|> (p >>= \v->pure [v])
 
 parseIdent :: Parser Token String
 parseIdent = trans2 (IdentToken "") (\(IdentToken e)->toString e)