mirror of
https://github.com/zachjs/sv2v.git
synced 2026-09-04 08:45:29 +02:00
apply BlockDecl conversions to tasks and functions
This commit is contained in:
@@ -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) =
|
||||
|
||||
Reference in New Issue
Block a user