Files
sv2v/src/Convert/Assertion.hs
T
Zachary Snow dd0eb5981d added source trace comments
- Trace comments cover module items, decls, and stmts
- Added pseudo-lexer to Alex parser for monadic Position production
- Added Position to every DeclToken
- Removed Comment PackageItem
- Added CommentStmt and CommentDecl
- Fixed traversal skipping outer MIAttr ModuleItems
- Generally cleaned up Parser modules
2020-01-30 22:17:17 -05:00

26 lines
733 B
Haskell

{- sv2v
- Author: Zachary Snow <[email protected]>
-
- Conversion for removing assertions. Assertions items are "commented out."
-}
module Convert.Assertion (convert) where
import Convert.Traverse
import Language.SystemVerilog.AST
convert :: [AST] -> [AST]
convert = map $ traverseDescriptions $ traverseModuleItems convertModuleItem
convertModuleItem :: ModuleItem -> ModuleItem
convertModuleItem (AssertionItem item) =
Generate $
map (GenModuleItem . MIPackageItem . Decl . CommentDecl) $
"removed an assertion item" :
(lines $ show $ AssertionItem item)
convertModuleItem other = traverseStmts convertStmt other
convertStmt :: Stmt -> Stmt
convertStmt (Assertion _) = Null
convertStmt other = other