@@ -75,7 +75,7 @@ import Data.Attoparsec.Text.Buffer (Buffer, buffer)
7575import Data.Char (chr, ord)
7676import Data.String (IsString(..))
7777import Data.Text.Internal (Text(..))
78−import Prelude hiding (getChar, length, succ, take, takeWhile)
78+import Prelude hiding (getChar, succ, take, takeWhile)
7979import qualified Data.Attoparsec.Internal.Types as T
8080import qualified Data.Attoparsec.Text.FastSet as Set
8181import qualified Data.Text as T
@@ -207,7 +207,7 @@ skipWhile p = go
207207 where
208208 go = do
209209 t <- T.takeWhile p <$> get
210− continue <- inputSpansChunks (length t)
210+ continue <- inputSpansChunks (size t)
211211 when continue go
212212{-# INLINE skipWhile #-}
213213
@@ -240,7 +240,7 @@ takeWhile p = (T.concat . reverse) `fmap` go []
240240 where
241241 go acc = do
242242 h <- T.takeWhile p <$> get
243− continue <- inputSpansChunks (length h)
243+ continue <- inputSpansChunks (size h)
244244 if continue
245245 then go (h:acc)
246246 else return (h:acc)
@@ -253,7 +253,7 @@ takeRest = go []
253253 if input
254254 then do
255255 s <- get
256− advance (length s)
256+ advance (size s)
257257 go (s:acc)
258258 else return (reverse acc)
259259
@@ -280,11 +280,11 @@ scan_ f s0 p = go [] s0
280280 go acc s = do
281281 input <- get
282282 case scanner s 0 input of
283− Continue s' -> do continue <- inputSpansChunks (length input)
283+ Continue s' -> do continue <- inputSpansChunks (size input)
284284 if continue
285285 then go (input : acc) s'
286286 else f s' (input : acc)
287− Finished n t -> do advance (length input - length t)
287+ Finished n t -> do advance (size input - size t)
288288 f s (T.take n input : acc)
289289{-# INLINE scan_ #-}
290290
@@ -323,9 +323,9 @@ takeWhile1 :: (Char -> Bool) -> Parser Text
323323takeWhile1 p = do
324324 (`when` demandInput) =<< endOfChunk
325325 h <- T.takeWhile p <$> get
326− let len = length h
327− when (len == 0) $ fail "takeWhile1"
328− advance len
326+ let size' = size h
327+ when (size' == 0) $ fail "takeWhile1"
328+ advance size'
329329 eoc <- endOfChunk
330330 if eoc
331331 then (h<>) `fmap` takeWhile p
@@ -503,5 +503,5 @@ substring (Pos pos) (Pos n) = Buf.substring pos n
503503lengthOf :: Buffer -> Pos
504504lengthOf = Pos . Buf.length
505505
506−length :: Text -> Pos
507−length (Text _ _ l) = Pos l
506+size :: Text -> Pos
507+size (Text _ _ l) = Pos l