language-sally 0.1.1.0 → 0.1.2.0
raw patch · 4 files changed
+32/−4 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Language.Sally.Expr: orPreds :: [SallyPred] -> SallyPred
+ Language.Sally.Types: [sqComment] :: SallyQuery -> Text
+ Language.Sally.Types: mkSallyQuery :: Name -> [SallyLet] -> SallyPred -> SallyQuery
- Language.Sally.Types: SallyQuery :: Name -> [SallyLet] -> SallyPred -> SallyQuery
+ Language.Sally.Types: SallyQuery :: Name -> [SallyLet] -> SallyPred -> Text -> SallyQuery
Files
- ChangeLog.md +14/−0
- language-sally.cabal +5/−1
- src/Language/Sally/Expr.hs +1/−0
- src/Language/Sally/Types.hs +12/−3
ChangeLog.md view
@@ -1,5 +1,19 @@ # Revision history for language-sally +## 0.1.2.0 -- 2017-06-02++* New contributors: Kevin Quick and Ryan Scott!+* Added a comment field to `SallyQuery` so that queries in the input language+ can be annotated.++## 0.1.1.0 -- 2017-06-22++* Added a type for Sally Queries called `SallyQuery`.++## 0.1.0.1 -- 2017-06-22++* Made haddock documentation improvements.+ ## 0.1.0.0 -- 2017-06-02 * First version. Released on an unsuspecting world.
language-sally.cabal view
@@ -1,5 +1,5 @@ name: language-sally-version: 0.1.1.0+version: 0.1.2.0 synopsis: AST and pretty printer for Sally description: AST and pretty printer for the Sally <https://github.com/SRI-CSL/sally> input language@@ -12,6 +12,10 @@ build-type: Simple extra-source-files: ChangeLog.md cabal-version: >=1.10++source-repository head+ type: git+ location: https://github.com/GaloisInc/language-sally library build-depends: base >= 4.8 && < 5
src/Language/Sally/Expr.hs view
@@ -37,6 +37,7 @@ , andExprs , andPreds , orExprs+ , orPreds , varExpr , varExpr' , xorExpr
src/Language/Sally/Types.hs view
@@ -42,6 +42,7 @@ , SallyTransition(..) , SallySystem(..) , SallyQuery(..)+ , mkSallyQuery , TrResult(..) ) where @@ -303,9 +304,17 @@ { sqName :: Name -- ^ system name , sqLet :: [SallyLet] -- ^ let bindings , sqPred :: SallyPred -- ^ predicate to query+ , sqComment :: Text -- ^ comment header for query } deriving (Eq, Show) +-- | Convenience function to construct a minimal SallyQuery, omitting+-- any optional information.+mkSallyQuery :: Name -> [SallyLet] -> SallyPred -> SallyQuery+mkSallyQuery name lets pred = SallyQuery { sqName=name, sqLet=lets, sqPred=pred+ , sqComment=""+ }+ instance ToSExp SallyQuery where toSExp sq = SXList $ bareText "query" : toSExp (sqName sq) :@@ -356,9 +365,7 @@ -- needs to come (almost) last vcat (system_comment : [sxPretty (tresSystem tr)]) <$$> -- queries- vcat (queries_comment : intersperse- sallyCom- (map sxPretty (tresQueries tr)))+ vcat (queries_comment : concatMap prettyQuery (tresQueries tr)) where consts = if null (tresConsts tr) then text ";; NONE" else vcat (map sxPretty (tresConsts tr))@@ -369,3 +376,5 @@ trans_comment = linebreak <> sallyCom <+> text "Transitions" system_comment = linebreak <> sallyCom <+> text "System Definition" queries_comment = linebreak <> sallyCom <+> text "Queries"+ prettyQuery q = [ sallyCom <+> text "Query " <+> text (T.unpack $ sqComment q)+ , sxPretty q ]