[project @ 1999-06-01 16:15:42 by simonmar]
[ghc-hetmet.git] / ghc / compiler / reader / PrefixSyn.lhs
index 3f2e2b3..cf2419b 100644 (file)
@@ -23,7 +23,8 @@ module PrefixSyn (
 
 import HsSyn
 import RdrHsSyn
-import Util            ( panic )
+import RdrName         ( RdrName )
+import Panic           ( panic )
 import Char            ( isDigit, ord )
 
 
@@ -35,39 +36,31 @@ type SrcFun  = RdrName
 
 \begin{code}
 data RdrBinding
-  = RdrNullBind
+  =    -- On input we use the Empty/And form rather than a list
+    RdrNullBind
   | RdrAndBindings     RdrBinding RdrBinding
 
-  | RdrTyDecl          RdrNameTyDecl
-  | RdrFunctionBinding SrcLine [RdrMatch]
-  | RdrPatternBinding  SrcLine [RdrMatch]
-  | RdrClassDecl       RdrNameClassDecl
-  | RdrInstDecl        RdrNameInstDecl
-  | RdrDefaultDecl     RdrNameDefaultDecl
-  | RdrForeignDecl      RdrNameForeignDecl
-
-                       -- signatures are mysterious; we can't
-                       -- tell if its a Sig or a ClassOpSig,
-                       -- so we just save the pieces:
+       -- Value bindings havn't been united with their
+       -- signatures yet
+  | RdrValBinding      RdrNameMonoBinds
+
+       -- Signatures are mysterious; we can't
+       -- tell if its a Sig or a ClassOpSig,
+       -- so we just save the pieces:
   | RdrSig             RdrNameSig
 
+       -- The remainder all fit into the main HsDecl form
+  | RdrHsDecl          RdrNameHsDecl
+
 type SigConverter = RdrNameSig -> RdrNameSig
 \end{code}
 
 \begin{code}
 data RdrMatch
-  = RdrMatch_NoGuard
-            SrcLine SrcFun
-            RdrNamePat
-            RdrNameHsExpr
-            RdrBinding
-
-  | RdrMatch_Guards
-            SrcLine SrcFun
-            RdrNamePat
-            [([RdrNameStmt], RdrNameHsExpr)]
-            -- (guard,         expr)
-            RdrBinding
+  = RdrMatch
+            [RdrNamePat]
+            (Maybe RdrNameHsType)
+            RdrNameGRHSs
 \end{code}
 
 Unscramble strings representing oct/dec/hex integer literals: