on master help sign in
switch to megaparsec 4 for stack LTS support
commit3069698f9c9b6d719c814b6bb5904e5c6219d476 authorAgentM <agentm@themactionfaction.com> dateWed 7 Sep 2016, 17:45 (10 years ago) parent6dbd0b1
3 files changed+11−8
project-m36.cabal+6−4 src/bin/TutorialD/Interpreter.hs+3−3 src/bin/TutorialD/Interpreter/Import/TutorialD.hs+2−1
project-m36.cabal+6−4
@@ -165,7 +165,8 @@ Executable tutd
165165 directory,
166166 filepath,
167167 temporary,
168− megaparsec,
168+--stack is still stuck on megaparsec 4, error-handling has changed in megaparsec 5
169+ megaparsec >= 4.4.0 && < 5.0,
169170 haskeline,
170171 base64-bytestring,
171172 optparse-applicative,
@@ -269,7 +270,7 @@ Test-Suite test-tutoriald
269270 type: exitcode-stdio-1.0
270271 main-is: test/TutorialD/Interpreter.hs
271272 Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, stm-containers, list-t, project-m36 == 0.1
272− Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.Import.BasicExamples
273+ Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator
273274 GHC-Options: -Wall
274275 Hs-Source-Dirs: ./src/bin, ., test
275276 CPP-Options: -DPROJECTM36_VERSION="v0.1"
@@ -278,6 +279,7 @@ Test-Suite test-tutoriald-atomfunctionscript
278279 Default-Language: Haskell2010
279280 Default-Extensions: OverloadedStrings
280281 type: exitcode-stdio-1.0
282+ Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types
281283 main-is: test/TutorialD/Interpreter/AtomFunctionScript.hs
282284 Build-Depends: base, HUnit, project-m36 == 0.1, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline
283285 GHC-Options: -Wall
@@ -405,7 +407,7 @@ Executable project-m36-websocket-server
405407 Default-Language: Haskell2010
406408 Build-Depends: base, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template, websockets, aeson, uuid-aeson, optparse-applicative, project-m36 == 0.1, containers, bytestring, text, vector, uuid, megaparsec, haskeline, mtl, directory, base64-bytestring
407409 Main-Is: ProjectM36/Server/WebSocket/websocket-server.hs
408− Other-Modules: ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types
410+ Other-Modules: ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.TransGraphRelationalOperator
409411 GHC-Options: -Wall
410412 CPP-Options: -DPROJECTM36_VERSION="v0.1"
411413 Hs-Source-Dirs: ./src/bin
@@ -416,7 +418,7 @@ Test-Suite test-websocket-server
416418 type: exitcode-stdio-1.0
417419 main-is: test/Server/WebSocket.hs
418420 Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, websockets, optparse-applicative, network, aeson, uuid-aeson, project-m36 == 0.1
419− Other-Modules: TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.TransactionGraphOperator, ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types
421+ Other-Modules: TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.TransactionGraphOperator, ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TransGraphRelationalOperator
420422 Default-Extensions: OverloadedStrings
421423 GHC-Options: -Wall
422424 Hs-Source-Dirs: ./src/bin, .
src/bin/TutorialD/Interpreter.hs+3−3
@@ -71,11 +71,11 @@ promptText mHeadName = "TutorialD (" `T.append` transInfo `T.append` "): "
7171 where
7272 transInfo = fromMaybe "<unknown>" mHeadName
7373
74−parseTutorialD :: T.Text -> Either (ParseError Char Dec) ParsedOperation
74+parseTutorialD :: T.Text -> Either ParseError ParsedOperation
7575parseTutorialD inputString = parse interpreterParserP "" inputString
7676
7777--only parse tutoriald which doesn't result in file I/O
78−safeParseTutorialD :: T.Text -> Either (ParseError Char Dec) ParsedOperation
78+safeParseTutorialD :: T.Text -> Either ParseError ParsedOperation
7979safeParseTutorialD inputString = parse safeInterpreterParserP "" inputString
8080
8181data SafeEvaluationFlag = SafeEvaluation | UnsafeEvaluation deriving (Eq)
@@ -194,7 +194,7 @@ reprLoop config sessionId conn = do
194194 Just line -> do
195195 case parseTutorialD (T.pack line) of
196196 Left err -> do
197− let strErr = parseErrorPretty err
197+ let strErr = show err --parseErrorPretty new in megaparsec 5
198198 displayOpResult $ DisplayErrorResult (T.pack strErr)
199199 Right parsed -> do
200200 evald <- evalTutorialD sessionId conn UnsafeEvaluation parsed
src/bin/TutorialD/Interpreter/Import/TutorialD.hs+2−1
@@ -19,7 +19,8 @@ importTutorialD pathIn = do
1919 Left err -> return $ Left (ImportError $ T.pack (show err))
2020 Right tutdData' -> do
2121 case parse multipleDatabaseContextExprP "import" tutdData' of
22− Left err -> pure (Left (PM36E.ParseError (T.pack (parseErrorPretty err))))
22+ --parseErrorPretty is new in megaparsec 5
23+ Left err -> pure (Left (PM36E.ParseError (T.pack (show err))))
2324 Right expr -> pure (Right expr)
2425
2526tutdImportP :: Parser DatabaseContextDataImportOperator