uu-parsinglib 2.2.0 → 2.2.1
raw patch · 3 files changed
+18/−4 lines, 3 files
Files
- Text/ParserCombinators/UU/Core.hs +1/−1
- Text/ParserCombinators/UU/Examples.hs +14/−1
- uu-parsinglib.cabal +3/−2
Text/ParserCombinators/UU/Core.hs view
@@ -419,7 +419,7 @@ instance (ExtApplicative (P_h st), ExtApplicative (P_f st)) => ExtApplicative (P_m st) where P_m (hp, fp) <* r = P_m (hp <* r, fp <* r) - r *> P_m (hq, fq) = P_m (r *> hq , r *> fq)+ r *> P_m ~(hq, fq) = P_m (r *> hq , r *> fq) f <$ r = P_m (f <$ r, f <$ r)
Text/ParserCombinators/UU/Examples.hs view
@@ -32,8 +32,21 @@ paz' = pSym (\t -> 'a' <= t && t <= 'z', "a .. z", 'k') ++-- s = pSym 'x' <|> (\ _ x _ -> x) <$> pSym '(' <*> s <*> pSym ')'+x = pa <|> (pSym '(' *> pa <* pSym ')')+y = pb <|> pSym '(' *> x <* pSym ')'++-- test_s = run s "x"+-- test_t = run t "x"++s = pSym 'x' <|> (\ _ x _ -> x) <$> pSym '(' <*> s <*> pSym ')'+t = pSym 'x' <|> (pSym '(' *> t <* pSym ')')+t1 = pSym 'x' <|> pSym '(' *> t + main :: IO ()-main = do print (test pa "a")+main = do print (test t1 "((a))")+ print (test pa "a") print (test pa "b") print (test pa2 "bbab") print (test pa "ba")
uu-parsinglib.cabal view
@@ -1,5 +1,5 @@ Name: uu-parsinglib-Version: 2.2.0+Version: 2.2.1 Build-Type: Simple License: LGPL Author: Doaitse Swierstra@@ -35,7 +35,8 @@ . * contain a module with many list-based derived combinators .- + * Version 2.2.1: bug fix: pattern matching too strict; ~ added+ Category: Text.ParserCombinators Parsing Text Library