mirror of
https://github.com/zachjs/sv2v.git
synced 2026-09-07 11:51:28 +02:00
- 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
26 lines
733 B
Haskell
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
|