Skip to content

Instantly share code, notes, and snippets.

@dminuoso

dminuoso/f.hs Secret

Created September 28, 2022 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dminuoso/065e043d05cd601008729bc3c8198239 to your computer and use it in GitHub Desktop.
Save dminuoso/065e043d05cd601008729bc3c8198239 to your computer and use it in GitHub Desktop.
parseNested :: FilePath -> Parser ()
parseNested path = do
txt <- readBuf path
oldBase <- gets (_psCurrentPath)
setCurrentPath (takeDirectory path)
r <- lift $ runParserT principleFile' path txt
case r of
Left bundle -> liftIO $ throwIO (CpeNestedError bundle)
Right () -> setCurrentPath oldBase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment