module FlatParse.Basic.Addr where
import FlatParse.Basic.Parser
import FlatParse.Basic.Base ( takeUnsafe#, atSkipUnsafe#, lookahead )
import GHC.Exts
import qualified Data.ByteString as B
withAddr# :: (Addr# -> ParserT st e a) -> ParserT st e a
withAddr# :: forall (st :: ZeroBitType) e a.
(Addr# -> ParserT st e a) -> ParserT st e a
withAddr# Addr# -> ParserT st e a
p = forall (st :: ZeroBitType) e a.
(ForeignPtrContents -> Addr# -> Addr# -> st -> Res# st e a)
-> ParserT st e a
ParserT \ForeignPtrContents
fp Addr#
eob Addr#
s st
st -> forall (st :: ZeroBitType) e a.
ParserT st e a
-> ForeignPtrContents -> Addr# -> Addr# -> st -> Res# st e a
runParserT# (Addr# -> ParserT st e a
p Addr#
s) ForeignPtrContents
fp Addr#
eob Addr#
s st
st
{-# inline withAddr# #-}
takeOffAddr# :: Addr# -> Int# -> Int# -> ParserT st e B.ByteString
takeOffAddr# :: forall (st :: ZeroBitType) e.
Addr# -> Int# -> Int# -> ParserT st e ByteString
takeOffAddr# Addr#
addr# Int#
offset# Int#
len# = forall (st :: ZeroBitType) e a.
Addr# -> Int# -> ParserT st e a -> ParserT st e a
withOffAddr# Addr#
addr# Int#
offset# (forall (st :: ZeroBitType) e. Int# -> ParserT st e ByteString
takeUnsafe# Int#
len#)
{-# inline takeOffAddr# #-}
withOffAddr# :: Addr# -> Int# -> ParserT st e a -> ParserT st e a
withOffAddr# :: forall (st :: ZeroBitType) e a.
Addr# -> Int# -> ParserT st e a -> ParserT st e a
withOffAddr# Addr#
addr# Int#
offset# =
forall (st :: ZeroBitType) e a.
Addr# -> ParserT st e a -> ParserT st e a
lookaheadFromAddr# Addr#
addr# forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (st :: ZeroBitType) e r.
Int# -> ParserT st e r -> ParserT st e r
atSkipUnsafe# Int#
offset#
{-# inline withOffAddr# #-}
lookaheadFromAddr# :: Addr# -> ParserT st e a -> ParserT st e a
lookaheadFromAddr# :: forall (st :: ZeroBitType) e a.
Addr# -> ParserT st e a -> ParserT st e a
lookaheadFromAddr# Addr#
s = forall (st :: ZeroBitType) e a. ParserT st e a -> ParserT st e a
lookahead forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (st :: ZeroBitType) e a.
Addr# -> ParserT st e a -> ParserT st e a
atAddr# Addr#
s
{-# inline lookaheadFromAddr# #-}
atAddr# :: Addr# -> ParserT st e a -> ParserT st e a
atAddr# :: forall (st :: ZeroBitType) e a.
Addr# -> ParserT st e a -> ParserT st e a
atAddr# Addr#
s (ParserT ForeignPtrContents -> Addr# -> Addr# -> st -> Res# st e a
p) = forall (st :: ZeroBitType) e a.
(ForeignPtrContents -> Addr# -> Addr# -> st -> Res# st e a)
-> ParserT st e a
ParserT \ForeignPtrContents
fp Addr#
eob Addr#
_ st
st -> ForeignPtrContents -> Addr# -> Addr# -> st -> Res# st e a
p ForeignPtrContents
fp Addr#
eob Addr#
s st
st
{-# inline atAddr# #-}