module Language.Sexp
(
decode
, encode
, parseSexp
, parseSexps
, parseSexp'
, parseSexps'
, prettySexp
, prettySexps
, Sexp (..)
, Atom (..)
, Kw (..)
, Position (..)
, dummyPos
, getPos
) where
import qualified Data.Text.Lazy as TL
import Language.Sexp.Types
import Language.Sexp.Parser (parseSexp_, parseSexps_)
import Language.Sexp.Lexer (lexSexp)
import Language.Sexp.Pretty (prettySexp, prettySexps)
import Language.Sexp.Encode (encode)
decode :: TL.Text -> Either String Sexp
decode = parseSexp "<str>"
parseSexp :: FilePath -> TL.Text -> Either String Sexp
parseSexp fn inp = parseSexp_ (lexSexp (Position fn 1 0) inp)
parseSexps :: FilePath -> TL.Text -> Either String [Sexp]
parseSexps fn inp = parseSexps_ (lexSexp (Position fn 1 0) inp)
parseSexp' :: Position -> TL.Text -> Either String Sexp
parseSexp' pos inp = parseSexp_ (lexSexp pos inp)
parseSexps' :: Position -> TL.Text -> Either String [Sexp]
parseSexps' pos inp = parseSexps_ (lexSexp pos inp)