gfse: some refactoring

This commit is contained in:
hallgren
2012-10-03 13:22:50 +00:00
parent a1d2d11057
commit 3582ae6e08
4 changed files with 38 additions and 44 deletions

View File

@@ -24,14 +24,13 @@ import SimpleEditor.JSON
parseModule (path,source) =
prop path $
(path.=) $
case runP pModDef (BS.pack source) of
Left (Pn l c,msg) ->
makeObj [prop "error" msg,
prop "location" (show l++":"++show c)]
makeObj ["error".=msg, "location".= show l++":"++show c]
Right mod -> case convModule mod of
Ok g -> makeObj [prop "converted" g]
Bad msg -> makeObj [prop "parsed" msg]
Ok g -> makeObj ["converted".=g]
Bad msg -> makeObj ["parsed".=msg]
{-
convAbstractFile path =