Commit a5ebb1e8 by Zachary Snow

minor output cleanup

parent 4cbfd8fa
...@@ -67,10 +67,13 @@ traverseType :: Type -> Writer Enums Type ...@@ -67,10 +67,13 @@ traverseType :: Type -> Writer Enums Type
traverseType (Enum t v rs) = do traverseType (Enum t v rs) = do
let baseType = toBaseType t let baseType = toBaseType t
let (tf, r) = typeRanges baseType let (tf, r) = typeRanges baseType
() <- tell $ Set.singleton (r, v) () <- tell $ Set.singleton (map simplifyRange r, v)
return $ tf (r ++ rs) return $ tf (r ++ rs)
traverseType other = return other traverseType other = return other
simplifyRange :: Range -> Range
simplifyRange (a, b) = (simplify a, simplify b)
-- drop any enum type casts in favor of implicit conversion from the -- drop any enum type casts in favor of implicit conversion from the
-- converted type -- converted type
traverseExpr :: Expr -> Expr traverseExpr :: Expr -> Expr
......
...@@ -43,7 +43,7 @@ data Type ...@@ -43,7 +43,7 @@ data Type
instance Show Type where instance Show Type where
show (Alias xx rs) = printf "%s%s" xx (showRanges rs) show (Alias xx rs) = printf "%s%s" xx (showRanges rs)
show (Net kw rs) = printf "%s%s" (show kw) (showRanges rs) show (Net kw rs) = printf "%s%s" (show kw) (showRanges rs)
show (Implicit sg rs) = printf "%s%s" (show sg) (showRanges rs) show (Implicit sg rs) = printf "%s%s" (showPad sg) (dropWhile (== ' ') $ showRanges rs)
show (IntegerVector kw sg rs) = printf "%s%s%s" (show kw) (showPadBefore sg) (showRanges rs) show (IntegerVector kw sg rs) = printf "%s%s%s" (show kw) (showPadBefore sg) (showRanges rs)
show (IntegerAtom kw sg ) = printf "%s%s" (show kw) (showPadBefore sg) show (IntegerAtom kw sg ) = printf "%s%s" (show kw) (showPadBefore sg)
show (NonInteger kw ) = printf "%s" (show kw) show (NonInteger kw ) = printf "%s" (show kw)
......
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