language-vhdl 0.1.2.8 → 0.1.3
raw patch · 3 files changed
+27/−8 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Language.VHDL.Syntax: UnconstrainedArrayDefinition :: [IndexSubtypeDefinition] -> (SubtypeIndication) -> UnconstrainedArrayDefinition
+ Language.VHDL.Syntax: UnconstrainedArrayDefinition :: [IndexSubtypeDefinition] -> SubtypeIndication -> UnconstrainedArrayDefinition
- Language.VHDL.Syntax: [arru_element_subtype_indication] :: UnconstrainedArrayDefinition -> (SubtypeIndication)
+ Language.VHDL.Syntax: [arru_element_subtype_indication] :: UnconstrainedArrayDefinition -> SubtypeIndication
Files
- language-vhdl.cabal +1/−1
- src/Language/VHDL/Pretty.hs +25/−6
- src/Language/VHDL/Syntax.hs +1/−1
language-vhdl.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: language-vhdl-version: 0.1.2.8+version: 0.1.3 synopsis: VHDL AST and pretty printer in Haskell. -- description: license: BSD3
src/Language/VHDL/Pretty.hs view
@@ -199,7 +199,7 @@ where header = text "CASE" <+> pp e <+> text "IS" body = indent $ vcat $ map pp cs- footer = text "END CASE" <+> cond id l+ footer = text "END CASE" <+> cond id l <+> semi instance Pretty CaseStatementAlternative where pp (CaseStatementAlternative c ss) =@@ -207,7 +207,7 @@ , indent $ vcat $ map pp ss] instance Pretty CharacterLiteral where- pp (CLit c) = char c+ pp (CLit c) = quotes (char c) instance Pretty Choice where pp (ChoiceSimple s) = pp s@@ -308,7 +308,7 @@ instance Pretty ConstantDeclaration where pp (ConstantDeclaration is s e) =- text "CONSTANT" <+> commaSep (fmap pp is) <+> colon <+> pp s <+> condL (text ":=") e+ text "CONSTANT" <+> commaSep (fmap pp is) <+> colon <+> pp s <+> condL (text ":=") e <+> semi instance Pretty ConstrainedArrayDefinition where pp (ConstrainedArrayDefinition i s) = text "ARRAY" <+> pp i <+> text "OF" <+> pp s@@ -521,8 +521,17 @@ instance Pretty FullTypeDeclaration where pp (FullTypeDeclaration i t) = text "TYPE" <+> pp i <+> text "IS" <+> pp t <+> semi +-- todo: printing its arguments like this is a slight hack, as we want different+-- styles for association lists in, for example, entity port declarations and+-- for functions. The fix would be to make 'ActualParamaterPart' a full data+-- type, and not a short-hand for 'AssociationList'. instance Pretty FunctionCall where+ pp (FunctionCall n Nothing) = pp n <+> text "()"+ pp (FunctionCall n (Just (AssociationList as)))+ = pp n <+> parens (hsep $ punctuate comma $ map pp as)+{- pp (FunctionCall n p) = pp n <+> cond parens p+-} instance Pretty GenerateStatement where pp (GenerateStatement l g d s) =@@ -578,7 +587,7 @@ ] where elseIf' :: [(Condition, SequenceOfStatements)] -> Doc- elseIf' = vcat . fmap (\(c, ss) -> (text "ELSEIF" <+> pp c <+> text "THEN") `hangs` (vpp ss))+ elseIf' = vcat . fmap (\(c, ss) -> (text "ELSIF" <+> pp c <+> text "THEN") `hangs` (vpp ss)) else' :: Maybe SequenceOfStatements -> Doc else' (Nothing) = empty@@ -741,12 +750,22 @@ --Instance Pretty PackageBodyDeclarativePart where pp = undefined +-- todo: like functions, this way of printing is a slight hack. To fix,+-- we have to make 'PackageDeclarativePart' a concrete data type and give+-- it a pretty printing instance. instance Pretty PackageDeclaration where+ pp (PackageDeclaration i ds) =+ vcat [ text "PACKAGE" <+> pp i <+> text "IS"+ , indent $ vcat $ map pp ds+ , text "END PACKAGE" <+> pp i <+> semi+ ]+{- pp (PackageDeclaration i d) = vcat [ text "PACKAGE" <+> pp i <+> text "IS" , indent $ pp d , text "END PACKAGE" <+> pp i <+> semi ]+-} instance Pretty PackageDeclarativeItem where pp (PHDISubprogDecl s) = pp s@@ -879,7 +898,7 @@ instance Pretty ReportStatement where pp (ReportStatement l e s) =- labels l $ (text "REPORT" <+> pp e `hangs` condL (text "SEVERITY") s)+ labels l $ (text "REPORT" <+> pp e `hangs` condL (text "SEVERITY") s) <+> semi instance Pretty ReturnStatement where pp (ReturnStatement l e) = label l <+> text "RETURN" <+> condR semi e@@ -961,7 +980,7 @@ pp (SignalDeclaration is s k e) = text "SIGNAL" <+> commaSep (fmap pp is)- <+> colon <+> pp s <+> cond id k+ <+> colon <+> pp s {-<+> cond id k-} <+> condL (text ":=") e <+> semi instance Pretty SignalKind where
src/Language/VHDL/Syntax.hs view
@@ -757,7 +757,7 @@ data UnconstrainedArrayDefinition = UnconstrainedArrayDefinition { arru_index_subtype_definition :: [IndexSubtypeDefinition]- , arru_element_subtype_indication :: (SubtypeIndication)+ , arru_element_subtype_indication :: SubtypeIndication } deriving (Eq, Show)