From bad6a0a6d565619509c728a9b750136214603728 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 4 Jul 2014 16:26:13 -0500 Subject: [PATCH] Add the NInherit type --- Nix/Types.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Nix/Types.hs b/Nix/Types.hs index 8e1b24a..7bb1ff9 100644 --- a/Nix/Types.hs +++ b/Nix/Types.hs @@ -106,6 +106,7 @@ data NExprF r | NIf r r r | NWith r r | NAssert r r + | NInherit [r] | NVar r | NApp r r @@ -147,6 +148,7 @@ instance Show f => Show (NExprF f) where show (NIf i t e) = "if " ++ show i ++ " then " ++ show t ++ " else " ++ show e show (NWith c v) = "with " ++ show c ++ "; " ++ show v show (NAssert e v) = "assert " ++ show e ++ "; " ++ show v + show (NInherit xs) = "inherit " ++ show xs show (NVar v) = show v show (NApp f x) = show f ++ " " ++ show x @@ -163,6 +165,7 @@ dumpExpr = cata phi where phi (NIf i t e) = "NIf " ++ i ++ " " ++ t ++ " " ++ e phi (NWith c v) = "NWith " ++ c ++ " " ++ v phi (NAssert e v) = "NAssert " ++ e ++ " " ++ v + phi (NInherit xs) = "NInherit " ++ show xs phi (NVar v) = "NVar " ++ v phi (NApp f x) = "NApp " ++ f ++ " " ++ x phi (NAbs a b) = "NAbs " ++ a ++ " " ++ b