{-# LANGUAGE UnboxedTuples, MagicHash, RecordWildCards #-}
module Parsley.Internal.Backend.Machine.Types.Input (module Parsley.Internal.Backend.Machine.Types.Input) where
import Parsley.Internal.Backend.Machine.InputRep (Rep)
import Parsley.Internal.Backend.Machine.Types.Base (Pos)
import Parsley.Internal.Backend.Machine.Types.Input.Offset (Offset(offset), mkOffset)
import Parsley.Internal.Common.Utils (Code)
data Input o = Input {
Input o -> Offset o
off :: Offset o,
Input o -> Code Pos
pos :: Code Pos
}
data Input# o = Input# {
Input# o -> Code (Rep o)
off# :: Code (Rep o),
Input# o -> Code Pos
pos# :: Code Pos
}
fromInput :: Input o -> Input# o
fromInput :: Input o -> Input# o
fromInput Input{Code Pos
Offset o
pos :: Code Pos
off :: Offset o
pos :: forall o. Input o -> Code Pos
off :: forall o. Input o -> Offset o
..} = Code (Rep o) -> Code Pos -> Input# o
forall o. Code (Rep o) -> Code Pos -> Input# o
Input# (Offset o -> Code (Rep o)
forall o. Offset o -> Code (Rep o)
offset Offset o
off) Code Pos
pos
toInput :: Word -> Input# o -> Input o
toInput :: Word -> Input# o -> Input o
toInput Word
u Input#{Code Pos
Code (Rep o)
pos# :: Code Pos
off# :: Code (Rep o)
pos# :: forall o. Input# o -> Code Pos
off# :: forall o. Input# o -> Code (Rep o)
..} = Offset o -> Code Pos -> Input o
forall o. Offset o -> Code Pos -> Input o
Input (Code (Rep o) -> Word -> Offset o
forall o. Code (Rep o) -> Word -> Offset o
mkOffset Code (Rep o)
off# Word
u) Code Pos
pos#