1module TutorialD.Interpreter.Import.TutorialD where
3import TutorialD.Interpreter.Import.Base
4import TutorialD.Interpreter.Base
5import TutorialD.Interpreter.DatabaseExpr
6import Text.Parsec.String
7import Text.Parsec hiding (try)
10import qualified Data.Text as T
11import Control.Exception
12--import a file containing TutorialD database context expressions
14importTutorialD :: FilePath -> IO (Either RelationalError DatabaseExpr)
15importTutorialD pathIn = do
16 tutdData <- try (readFile pathIn) :: IO (Either IOError String)
18 Left err -> return $ Left (ImportError $ T.pack (show err))
20 let dbexprsErr = map (parse databaseExprP "import") (lines tutdData')
21 errs = lefts dbexprsErr
23 err2:_ -> return $ Left (ParseError (T.pack (show err2)))
24 [] -> return $ Right (MultipleExpr (rights dbexprsErr))
26tutdImportP :: Parser DatabaseContextDataImportOperator
28 reserved ":importtutd"
31 return $ DatabaseContextDataImportOperator path importTutorialD
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list