packages feed

polyparse 1.8 → 1.9

raw patch · 10 files changed

+36/−18 lines, 10 files

Files

@@ -6,7 +6,7 @@     (c) copyright 1998-2000    Malcolm Wallace The modules Text.ParserCombinators.Poly* and Text.Parse and Text.Parse.* are-    (c) copyright 2006-2011    Malcolm Wallace+    (c) copyright 2006-2013    Malcolm Wallace  These modules are licensed under the terms of the GNU Lesser General Public Licence (LGPL), which can be found in the file called
polyparse.cabal view
@@ -1,5 +1,5 @@ name:		polyparse-version:	1.8+version:	1.9 license:	LGPL license-file:	COPYRIGHT author:		Malcolm Wallace <Malcolm.Wallace@me.com>@@ -44,6 +44,6 @@         Text.ParserCombinators.Poly.Text         Text.ParserCombinators.Poly.StateText --      Text.Parse.Text-  cpp-options:		-DVERSION="1.8"+  cpp-options:		-DVERSION="1.9"   nhc98-options:	-K6M   extensions:		CPP
src/Text/ParserCombinators/Poly/Base.hs view
@@ -179,10 +179,14 @@        }  -- | Parse a bracketed item, discarding the brackets.+--   If everything matches /except/ the closing bracket, the whole+--   parse fails soft, which can give less-than-satisfying error messages.+--   If you want better error messages, try calling with e.g.+--     @bracket open (commit close) item@ bracket :: PolyParse p => p bra -> p ket -> p a -> p a bracket open close p = do     do { open    `adjustErr` ("Missing opening bracket:\n\t"++)-       ; p `discard` (close `adjustErrBad` ("Missing closing bracket:\n\t"++))+       ; p `discard` (close `adjustErr` ("Missing closing bracket:\n\t"++))        }  -- | @manyFinally e t@ parses a possibly-empty sequence of @e@'s,
src/Text/ParserCombinators/Poly/ByteString.hs view
@@ -43,12 +43,14 @@     (P f) >>= g  = P (continue . f)       where         continue (Success ts x)             = let (P g') = g x in g' ts-        continue (Committed (Committed r))  = continue (Committed r)         continue (Committed r)              = Committed (continue r)         continue (Failure ts e)             = Failure ts e  instance Commitment Parser where-    commit (P p)         = P (Committed . p)+    commit (P p)         = P (Committed . squash . p)+      where+        squash (Committed r) = squash r+        squash r             = r     (P p) `adjustErr` f  = P (adjust . p)       where         adjust (Failure z e) = Failure z (f e)
src/Text/ParserCombinators/Poly/ByteStringChar.hs view
@@ -42,12 +42,14 @@     (P f) >>= g  = P (continue . f)       where         continue (Success ts x)             = let (P g') = g x in g' ts-        continue (Committed (Committed r))  = continue (Committed r)         continue (Committed r)              = Committed (continue r)         continue (Failure ts e)             = Failure ts e  instance Commitment Parser where-    commit (P p)         = P (Committed . p)+    commit (P p)         = P (Committed . squash . p)+      where+        squash (Committed r) = squash r+        squash r             = r     (P p) `adjustErr` f  = P (adjust . p)       where         adjust (Failure z e) = Failure z (f e)
src/Text/ParserCombinators/Poly/Lex.hs view
@@ -59,12 +59,14 @@     (P f) >>= g  = P (continue . f)       where         continue (Success ts x)             = let (P g') = g x in g' ts-        continue (Committed (Committed r))  = continue (Committed r)         continue (Committed r)              = Committed (continue r)         continue (Failure ts e)             = Failure ts e  instance Commitment (Parser t) where-    commit (P p)         = P (Committed . p)+    commit (P p)         = P (Committed . squash . p)+      where+        squash (Committed r) = squash r+        squash r             = r     (P p) `adjustErr` f  = P (adjust . p)       where         adjust (Failure z e) = Failure z (f e)
src/Text/ParserCombinators/Poly/Parser.hs view
@@ -35,12 +35,14 @@     (P f) >>= g  = P (continue . f)       where         continue (Success ts x)             = let (P g') = g x in g' ts-        continue (Committed (Committed r))  = continue (Committed r)         continue (Committed r)              = Committed (continue r)         continue (Failure ts e)             = Failure ts e  instance Commitment (Parser t) where-    commit (P p)         = P (Committed . p)+    commit (P p)         = P (Committed . squash . p)+      where+        squash (Committed r) = squash r+        squash r             = r     (P p) `adjustErr` f  = P (adjust . p)       where         adjust (Failure z e) = Failure z (f e)
src/Text/ParserCombinators/Poly/StateParser.hs view
@@ -38,12 +38,14 @@     (P f) >>= g  = P (\s-> continue . f s)       where         continue (Success (ts,s) x)        = let (P g') = g x in g' s ts-        continue (Committed (Committed r)) = continue (Committed r)         continue (Committed r)             = Committed (continue r)         continue (Failure tss e)           = Failure tss e  instance Commitment (Parser s t) where-    commit (P p)         = P (\s-> Committed . p s)+    commit (P p)         = P (\s-> Committed . squash . p s)+      where+        squash (Committed r) = squash r+        squash r             = r     (P p) `adjustErr` f  = P (\s-> adjust . p s)       where         adjust (Failure zs e)  = Failure zs (f e)
src/Text/ParserCombinators/Poly/StateText.hs view
@@ -49,12 +49,14 @@     (P f) >>= g  = P (\s-> continue . f s)       where         continue (Success (ts,s) x)         = let (P g') = g x in g' s ts-        continue (Committed (Committed r))  = continue (Committed r)         continue (Committed r)              = Committed (continue r)         continue (Failure ts e)             = Failure ts e  instance Commitment (Parser s) where-    commit (P p)         = P (\s-> Committed . p s)+    commit (P p)         = P (\s-> Committed . squash . p s)+      where+        squash (Committed r) = squash r+        squash r             = r     (P p) `adjustErr` f  = P (\s-> adjust . p s)       where         adjust (Failure z e) = Failure z (f e)
src/Text/ParserCombinators/Poly/Text.hs view
@@ -43,12 +43,14 @@     (P f) >>= g  = P (continue . f)       where         continue (Success ts x)             = let (P g') = g x in g' ts-        continue (Committed (Committed r))  = continue (Committed r)         continue (Committed r)              = Committed (continue r)         continue (Failure ts e)             = Failure ts e  instance Commitment Parser where-    commit (P p)         = P (Committed . p)+    commit (P p)         = P (Committed . squash . p)+      where+        squash (Committed r) = squash r+        squash r             = r     (P p) `adjustErr` f  = P (adjust . p)       where         adjust (Failure z e) = Failure z (f e)