{-# LANGUAGE PatternSynonyms #-}
module Parsley.Internal (
module Core,
module Primitives,
module THUtils,
module Trace,
module Backend,
parse
) where
import Parsley.Internal.Backend (codeGen, eval)
import Parsley.Internal.Frontend (compile)
import Parsley.Internal.Backend as Backend (
Input,
)
import Parsley.Internal.Core as Core
import Parsley.Internal.Core.Primitives as Primitives (
pure, (<*>), (*>), (<*),
(<|>), empty,
satisfy, lookAhead, try, notFollowedBy,
loop,
Reg, newRegister, get, put,
conditional, branch,
line, col,
debug
)
import Parsley.Internal.Common.Utils as THUtils (Quapplicative(..), WQ, Code, makeQ)
import Parsley.Internal.Trace as Trace (Trace(trace))
parse :: (Trace, Input input) => Parser a -> Code (input -> Maybe a)
parse :: Parser a -> Code (input -> Maybe a)
parse Parser a
p = [||\input -> $$(eval [||input||] (compile (try p) codeGen))||]