packages feed

ats-format 0.1.0.12 → 0.1.0.14

raw patch · 4 files changed

+12/−5 lines, 4 files

Files

ats-format.cabal view
@@ -1,5 +1,5 @@ name:                ats-format-version:             0.1.0.12+version:             0.1.0.14 synopsis:            A source-code formatter for ATS description:         An opinionated source-code formatter for ATS (http://www.ats-lang.org/). homepage:            https://hub.darcs.net/vmchale/ats-format#readme
src/Language/ATS/Parser.y view
@@ -33,6 +33,7 @@ %token     fun { Keyword $$ KwFun }     fn { Keyword $$ KwFn }+    castfn { Keyword $$ KwCastfn }     prfun { Keyword $$ KwPrfun }     fnx { Keyword $$ KwFnx }     and { Keyword $$ KwAnd }@@ -489,12 +490,16 @@  -- | Function declaration FunDecl : fun PreFunction { [ Func $1 (Fun $2) ] }-        | fn PreFunction { [ Func $1 (Fn $2) ] }         | prfun PreFunction { [ Func $1 (PrFun $2) ] }         | fnx PreFunction { [ Func $1 (Fnx $2) ] }-        | extern FunDecl { over _head (Extern $1) $2 }+        | castfn PreFunction { [ Func $1 (CastFn $2) ] }+        | fn PreFunction { [ Func $1 (Fn $2) ] }         | FunDecl and PreFunction { Func $2 (And $3) : $1 }+        | extern FunDecl { over _head (Extern $1) $2 }         | extern fun PreFunction eq {% Left $ Expected $1 "Declaration" "Function body" }+        | extern fnx PreFunction eq {% Left $ Expected $1 "Declaration" "Function body" }+        | extern praxi PreFunction eq {% Left $ Expected $1 "Declaration" "Function body" }+        | extern prfun PreFunction eq {% Left $ Expected $1 "Declaration" "Function body" }         | lambda {% Left $ Expected $1 "Function declaration" "lam" }         | llambda {% Left $ Expected $1 "Function declaration" "llam" } 
src/Language/ATS/PrettyPrint.hs view
@@ -181,8 +181,8 @@         a (BeginF _ e)             | not (startsParens e) = linebreak <> indent 2 ("begin" <$> indent 2 e <$> "end")             | otherwise = e-        a (FixAtF (PreF n s [] [] as t Nothing (Just e))) = "fix@" <+> pretty n <+> prettyArgs as <+> pretty s <> ":" <+> pretty t <+> "=>" </> pretty e-        a (LambdaAtF (PreF Unnamed{} s [] [] as t Nothing (Just e))) = "lam@" <+> prettyArgs as <+> pretty s <> ":" <+> pretty t <+> "=>" </> pretty e+        a (FixAtF (PreF n s [] [] as t Nothing (Just e))) = "fix@" <+> pretty n <+> prettyArgs as <+> ":" <> pretty s <+> pretty t <+> "=>" </> pretty e+        a (LambdaAtF (PreF Unnamed{} s [] [] as t Nothing (Just e))) = "lam@" <+> prettyArgs as <+> ":" <> pretty s <+> pretty t <+> "=>" </> pretty e         a (AddrAtF _ e)                = "addr@" <> e         a (ViewAtF _ e)                = "view@" <> e         a _ = "FIXME"@@ -438,6 +438,7 @@     pretty (OverloadOp _ o n)    = "overload" <+> pretty o <+> "with" <+> pretty n     pretty (Func _ (Fn pref))    = "fn" </> pretty pref     pretty (Func _ (Fun pref))   = "fun" </> pretty pref+    pretty (Func _ (CastFn pref)) = "castfn" </> pretty pref     pretty (Func _ (Fnx pref))   = "fnx" </> pretty pref     pretty (Func _ (And pref))   = "and" </> pretty pref     pretty (Func _ (Praxi pref)) = "praxi" </> pretty pref
src/Language/ATS/Types.hs view
@@ -269,6 +269,7 @@               | PrFun PreFunction               | PrFn PreFunction               | Praxi PreFunction+              | CastFn PreFunction               deriving (Show, Eq, Generic, NFData)  data PreFunction = PreF { fname         :: Name -- ^ Function name