Commit 3d3359d3 by Zachary Snow

apply BlockDecl conversions to tasks and functions

parent 5ef24d2d
...@@ -15,9 +15,21 @@ import Language.SystemVerilog.AST ...@@ -15,9 +15,21 @@ import Language.SystemVerilog.AST
convert :: [AST] -> [AST] convert :: [AST] -> [AST]
convert = convert =
map map $ traverseDescriptions $ traverseModuleItems
$ traverseDescriptions $ traverseModuleItems (convertModuleItem . traverseStmts convertStmt)
$ traverseStmts $ convertStmt
convertModuleItem :: ModuleItem -> ModuleItem
convertModuleItem (MIPackageItem (Function ml t f decls stmts)) =
MIPackageItem $ Function ml t f decls' stmts'
where
Block Seq "" decls' stmts' = convertStmt $
Block Seq "" decls stmts
convertModuleItem (MIPackageItem (Task ml f decls stmts)) =
MIPackageItem $ Task ml f decls' stmts'
where
Block Seq "" decls' stmts' = convertStmt $
Block Seq "" decls stmts
convertModuleItem other = other
convertStmt :: Stmt -> Stmt convertStmt :: Stmt -> Stmt
convertStmt (Block Seq name decls stmts) = convertStmt (Block Seq name decls stmts) =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment