fix compile errors

This commit is contained in:
Benno Fünfstück 2014-08-13 19:33:19 +02:00
parent 0aa8fc2602
commit a0e5650f42
2 changed files with 9 additions and 9 deletions

View file

@ -10,14 +10,14 @@ prettyBind (NamedVar n v) = prettyNix n <+> equals <+> prettyNix v <> semi
prettyBind (Inherit ns) = text "inherit" <+> fillSep (map prettyNix ns) <> semi
prettyBind (ScopedInherit s ns) = text "inherit" <+> parens (prettyNix s) <+> fillSep (map prettyNix ns) <> semi
prettyFormals :: Formals -> Doc
prettyFormals :: Formals NExpr -> Doc
prettyFormals (FormalName n) = text $ unpack n
prettyFormals (FormalSet s) =prettyParamSet s
prettyFormals (FormalLeftAt s n) = prettyParamSet s <> text "@" <> text (unpack n)
prettyFormals (FormalRightAt n s) text (unpack n) <> text "@" <> prettyParamSet s
prettyFormals (FormalSet s) = prettyParamSet s
prettyFormals (FormalLeftAt n s) = text (unpack n) <> text "@" <> prettyParamSet s
prettyFormals (FormalRightAt s n) = prettyParamSet s <> text "@" <> text (unpack n)
prettyParamSet :: FormalParamSet -> Doc
prettyParamSet s = lbrace <+> hcat (map prettySetArg $ toList args) <+> rbrace
prettyParamSet :: FormalParamSet NExpr -> Doc
prettyParamSet (FormalParamSet args) = lbrace <+> hcat (map prettySetArg $ toList args) <+> rbrace
prettySetArg :: (Text, Maybe NExpr) -> Doc
prettySetArg (n, Nothing) = text (unpack n)

View file

@ -20,8 +20,8 @@ case_constant_bool = do
case_simple_set :: Assertion
case_simple_set = assertParseString "{ a = 23; b = 4; }" $ Fix $ NSet NonRec
[ (mkSym "a", mkInt 23)
, (mkSym "b", mkInt 4)
[ NamedVar (mkSym "a") $ mkInt 23
, NamedVar (mkSym "b") $ mkInt 4
]
case_int_list :: Assertion
@ -42,7 +42,7 @@ case_lambda_app_int = assertParseString "(a: a) 3" $ Fix (NApp lam int) where
case_simple_let :: Assertion
case_simple_let = assertParseString "let a = 4; in a" $ Fix (NLet binds asym) where
binds = [(asym, mkInt 4)]
binds = [NamedVar asym $ mkInt 4]
asym = mkSym "a"
case_identifier_special_chars :: Assertion