git.iko.soy/typeable/attoparsec
on master help sign in
Fix up some internal comments
commit4b7b596f8a19f2b2049e98dacdedb7425454f54b authorBryan O'Sullivan <bos@serpentine.com> dateFri 27 Mar 2015, 15:00 (12 years ago) parentf486be3
2 files changed+1−2
Data/Attoparsec/ByteString/Internal.hs−1 Data/Attoparsec/Text/Internal.hs+1−1
Data/Attoparsec/ByteString/Internal.hs−1
@@ -501,7 +501,6 @@ ensure n = T.Parser $ \t pos more lose succ ->
501501 then succ t pos more (substring pos (Pos n) t)
502502 -- The uncommon case is kept out-of-line to reduce code size:
503503 else ensureSuspended n t pos more lose succ
504−-- Non-recursive so the bounds check can be inlined:
505504{-# INLINE ensure #-}
506505
507506-- | Return both the result of a parse and the portion of the input
Data/Attoparsec/Text/Internal.hs+1−1
@@ -476,7 +476,6 @@ ensure n = T.Parser $ \t pos more lose succ ->
476476 Just n' -> succ t pos more (n', substring pos n' t)
477477 -- The uncommon case is kept out-of-line to reduce code size:
478478 Nothing -> ensureSuspended n t pos more lose succ
479−-- Non-recursive so the bounds check can be inlined:
480479{-# INLINE ensure #-}
481480
482481-- | Return both the result of a parse and the portion of the input
@@ -487,6 +486,7 @@ match p = T.Parser $ \t pos more lose succ ->
487486 (substring pos (pos'-pos) t', a)
488487 in runParser p t pos more lose succ'
489488
489+-- | Ensure that at least @n@ code points of input are available.
490490lengthAtLeast :: Pos -> Int -> Buffer -> Maybe Pos
491491lengthAtLeast pos n t = go 0 (fromPos pos)
492492 where go i !p