language-ats 0.3.0.5 → 0.3.0.6
raw patch · 5 files changed
+11/−7 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- language-ats.cabal +1/−1
- src/Language/ATS.hs +5/−4
- src/Language/ATS/Lexer.x +1/−1
- src/Language/ATS/Parser.y +3/−1
- src/Language/ATS/PrettyPrint.hs +1/−0
language-ats.cabal view
@@ -1,5 +1,5 @@ name: language-ats-version: 0.3.0.5+version: 0.3.0.6 synopsis: Parser and pretty-printer for ATS. description: Parser and pretty-printer for [ATS](http://www.ats-lang.org/), written with Happy and Alex. license: BSD3
src/Language/ATS.hs view
@@ -75,7 +75,8 @@ -- TODO use prepocessing?? here? getDependencies :: ATS -> [FilePath]-getDependencies (ATS ds) = catMaybes (g <$> ds)- where g (Staload _ _ s) = Just s- g (Include s) = Just s- g _ = Nothing+getDependencies (ATS ds) = join $ catMaybes (g <$> ds)+ where g (Staload _ _ s) = Just [s]+ g (Include s) = Just [s]+ g (Local _ as as') = Just $ getDependencies as <> getDependencies as'+ g _ = Nothing
src/Language/ATS/Lexer.x view
@@ -88,7 +88,7 @@ $in_operator = $special # [\)\(\}\{\_\[\]\,] $in_l = $in_operator # [\<] $in_r = $in_operator # [\>]-@operator = "+" | "-" | "*" | "/" | "<" | ">" | "=" | "~" | "?" | "%" | "#[" | $in_r{2,} | $in_l{2,}+@operator = "+" | "-" | "*" | "/" | "<" | ">" | "=" | "~" | "?" | "%" | "#[" | $in_r{2,} | $in_l{2,} | $in_r{2,} $in_l+ @double_parens = "(" (@block_comment | $white+ | \n | "//".*)+ ")" | "()" @double_braces = "{" @block_comment "}" | "{}"
src/Language/ATS/Parser.y view
@@ -176,7 +176,7 @@ fixAt { Keyword $$ KwFixAt } lamAt { Keyword $$ KwLambdaAt } infixr { FixityTok $$ "infixr" }- infixl { FixityTok $$ "infixr" }+ infixl { FixityTok $$ "infixl" } prefix { FixityTok $$ "prefix" } postfix { FixityTok $$ "postfix" } customOperator { $$@Operator{} }@@ -231,6 +231,7 @@ | openParen TypeIn vbar Type closeParen { ProofType $1 $2 $4 } -- FIXME can have multiple first parts | identifierSpace identifier { Dependent (Unqualified $ to_string $1) [Named (Unqualified $ to_string $2)] } | openParen TypeIn closeParen { Tuple $1 $2 }+ | openParen TypeIn rbrace {% Left $ Expected $3 ")" "}" } | openParen Type closeParen { ParenType $1 $2 } | doubleParens { NoneType $1 } | minus {% Left $ Expected $1 "Type" "-" }@@ -502,6 +503,7 @@ | dollar identifier dot identifierSpace { Qualified $1 (to_string $4) (to_string $2) } | dollar identifier dot identifier dollar IdentifierOr { Qualified $1 (to_string $4 ++ ('$' : $6)) (to_string $2) } | specialIdentifier { SpecialName (token_posn $1) (to_string $1) }+ | customOperator { Unqualified (to_string $1) } | dollar {% Left $ Expected $1 "Name" "$" } -- | Parse a list of values in a record
src/Language/ATS/PrettyPrint.hs view
@@ -580,6 +580,7 @@ pretty (Stacst _ n t Nothing) = "stacst" </> pretty n <+> ":" </> pretty t pretty (Stacst _ n t (Just e)) = "stacst" </> pretty n <+> ":" </> pretty t <+> "=" </> pretty e pretty (PropDef _ s as t) = "propdef" </> text s <+> prettyArgsNil as <+> "=" </> pretty t+ pretty (Local _ d (ATS [])) = "local" <$> indent 2 (pretty d) <$> "in end" pretty (Local _ d d') = "local" <$> indent 2 (pretty d) <$> "in" <$> indent 2 (pretty d') <$> "end" pretty (FixityDecl f ss) = pretty f <+> hsep (fmap text ss) pretty (StaVal us i t) = "val" </> mconcat (fmap pretty us) <+> text i <+> ":" <+> pretty t