[project @ 2004-09-27 11:35:59 by simonmar]
[ghc-hetmet.git] / ghc / compiler / hsSyn / HsExpr.lhs
index 1ff0e8f..88b681c 100644 (file)
@@ -123,9 +123,14 @@ data HsExpr id
                                        --      type of input record)
                 (HsRecordBinds id)
 
-  | ExprWithTySig                      -- signature binding
+  | ExprWithTySig                      -- e :: type
                (LHsExpr id)
                (LHsType id)
+
+  | ExprWithTySigOut                   -- TRANSLATION
+               (LHsExpr id)
+               (LHsType Name)          -- Retain the signature for round-tripping purposes
+
   | ArithSeqIn                         -- arithmetic sequence
                (ArithSeqInfo id)
   | ArithSeqOut
@@ -355,6 +360,9 @@ ppr_expr (RecordUpdOut aexp _ _ rbinds)
 ppr_expr (ExprWithTySig expr sig)
   = hang (nest 2 (ppr_lexpr expr) <+> dcolon)
         4 (ppr sig)
+ppr_expr (ExprWithTySigOut expr sig)
+  = hang (nest 2 (ppr_lexpr expr) <+> dcolon)
+        4 (ppr sig)
 
 ppr_expr (ArithSeqIn info)
   = brackets (ppr info)
@@ -403,7 +411,8 @@ ppr_expr (HsType id) = ppr id
 
 ppr_expr (HsSpliceE s)       = pprSplice s
 ppr_expr (HsBracket b)       = pprHsBracket b
-ppr_expr (HsBracketOut e ps) = ppr e $$ ptext SLIT("where") <+> ppr ps
+ppr_expr (HsBracketOut e []) = ppr e   
+ppr_expr (HsBracketOut e ps) = ppr e $$ ptext SLIT("pending") <+> ppr ps
 
 ppr_expr (HsProc pat (L _ (HsCmdTop cmd _ _ _)))
   = hsep [ptext SLIT("proc"), ppr pat, ptext SLIT("->"), ppr cmd]
@@ -461,6 +470,8 @@ pprParendExpr expr
       ExplicitPArr _ _  -> pp_as_was
       ExplicitTuple _ _        -> pp_as_was
       HsPar _          -> pp_as_was
+      HsBracket _      -> pp_as_was
+      HsBracketOut _ []        -> pp_as_was
                        
       _                        -> parens pp_as_was
 \end{code}