mirror of https://github.com/zachjs/sv2v.git
apply BlockDecl conversions to tasks and functions
This commit is contained in:
parent
5ef24d2d94
commit
3d3359d35a
|
|
@ -15,9 +15,21 @@ import Language.SystemVerilog.AST
|
|||
|
||||
convert :: [AST] -> [AST]
|
||||
convert =
|
||||
map
|
||||
$ traverseDescriptions $ traverseModuleItems
|
||||
$ traverseStmts $ convertStmt
|
||||
map $ traverseDescriptions $ traverseModuleItems
|
||||
(convertModuleItem . 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 (Block Seq name decls stmts) =
|
||||
|
|
|
|||
Loading…
Reference in New Issue