git.iko.soy/typeable/attoparsec
on master help sign in
Merge.
commitf6680b04f58d99d442e8bcfe6822199509ae985e authorBryan O'Sullivan <bos@serpentine.com> dateWed 7 Jan 2009, 17:45 (18 years ago) parentcde1d60dbafb6c
4 files changed+16−12
.hgignore+1 .hgtags+4−3 attoparsec.cabal+1−1 src/Data/ParserCombinators/Attoparsec/Internal.hs+10−8
.hgignore+1
@@ -5,3 +5,4 @@ syntax: glob
55*.o
66*~
77.*.swp
8+*.orig
.hgtags+4−3
@@ -1,7 +1,8 @@
11187e68710ea1903fdb2fcc78964574982830adc0 0.2
2−1f5944a3920322fa8e2bb2fbc9382223968a77d7 0.2.2
3−7ad5cecf582ce41410159040c6a47002ad61613f 0.5
4−91a8667f027294bdf9df7bbe3fe1083a8d09f26c 0.4
529c2929e868fdfe4cb267f1cc9d41bdab31d97640 0.2.1
3+1f5944a3920322fa8e2bb2fbc9382223968a77d7 0.2.2
64d4934c7fdf544d4e5b2925cada4b91d92a8948c2 0.3
5+91a8667f027294bdf9df7bbe3fe1083a8d09f26c 0.4
6+7ad5cecf582ce41410159040c6a47002ad61613f 0.5
77d5f93303fb5169d856291fa6cde834b89866a1ed 0.5.1
8+ace3afe105f50a5c90ee135dc72ad306fc3b296c 0.6
attoparsec.cabal+1−1
@@ -1,5 +1,5 @@
11name: attoparsec
2−version: 0.5
2+version: 0.6
33license: BSD3
44license-file: LICENSE
55category: Text, Parsing
src/Data/ParserCombinators/Attoparsec/Internal.hs+10−8
@@ -226,14 +226,16 @@ string s = Parser $ \(S sb lb n) ->
226226endOfLine :: Parser ()
227227endOfLine = Parser $ \(S sb lb n) ->
228228 let bs = sb +: lb
229− in case I.w2c (U.unsafeHead sb) of
230− '\n' -> Right ((), mkState (LB.tail bs) (n + 1))
231− '\r' -> let (h,t) = LB.splitAt 2 bs
232− rn = L8.pack "\r\n"
233− in if h == rn
234− then Right ((), mkState t (n + 2))
235− else Right ((), mkState (LB.tail bs) (n + 1))
236− _ -> Left (bs, ["EOL"])
229+ in if SB.null sb
230+ then Left (bs, ["EOL"])
231+ else case I.w2c (U.unsafeHead sb) of
232+ '\n' -> Right ((), mkState (LB.tail bs) (n + 1))
233+ '\r' -> let (h,t) = LB.splitAt 2 bs
234+ rn = L8.pack "\r\n"
235+ in if h == rn
236+ then Right ((), mkState t (n + 2))
237+ else Right ((), mkState (LB.tail bs) (n + 1))
238+ _ -> Left (bs, ["EOL"])
237239
238240-- | Satisfy a literal string, after applying a transformation to both
239241-- it and the matching text.