mirror of
https://github.com/macocianradu/RosettaHaskellCompiler.git
synced 2026-03-18 21:10:07 +00:00
parsing works with path expressions
This commit is contained in:
10
app/Main.hs
10
app/Main.hs
@@ -26,6 +26,8 @@ import Data.Void
|
||||
import Utils.Utils
|
||||
import Data.Text (Text)
|
||||
|
||||
-- :set args resources/Rosetta/test-multiple.rosetta
|
||||
|
||||
-- :set args resources/Rosetta/test-all.rosetta
|
||||
-- :l resources/Generated/testAll.hs resources/Generated/testPeriod.hs
|
||||
|
||||
@@ -62,10 +64,12 @@ parseWithImport file =
|
||||
let importedFunctions = concat $ sndlst importedSymbolTable
|
||||
case addNewTypes importedTypes objs of
|
||||
Left errors -> error $ show errors
|
||||
Right definedTypes ->
|
||||
case addNewFunctions (definedTypes, importedFunctions) objs of
|
||||
Right emptyTypes ->
|
||||
case populateTypes emptyTypes of
|
||||
Left errors -> error $ show errors
|
||||
Right definedFunctions -> return $ ((definedTypes, definedFunctions), (MakeHeader name desc vers imp, objs)) : concat imports
|
||||
Right definedTypes -> case addNewFunctions (definedTypes, importedFunctions) objs of
|
||||
Left errors -> error $ show errors
|
||||
Right definedFunctions -> return $ ((definedTypes, definedFunctions), (MakeHeader name desc vers imp, objs)) : concat imports
|
||||
|
||||
-- |Parse a file into a list of RosettaObjects
|
||||
parseFile :: String -> Either (ParseErrorBundle Text Void) (Header, [RosettaObject])
|
||||
|
||||
Reference in New Issue
Block a user