[project @ 2002-06-07 07:16:04 by chak]
[ghc-hetmet.git] / ghc / compiler / parser / Parser.y
index 6c0fccb..ea8f6f5 100644 (file)
@@ -1,6 +1,6 @@
 {-                                                             -*-haskell-*-
 -----------------------------------------------------------------------------
-$Id: Parser.y,v 1.98 2002/05/27 15:28:08 simonpj Exp $
+$Id: Parser.y,v 1.100 2002/06/07 07:16:05 chak Exp $
 
 Haskell grammar.
 
@@ -805,9 +805,9 @@ atype :: { RdrNameHsType }
        | tyvar                         { HsTyVar $1 }
        | '(' type ',' comma_types1 ')' { HsTupleTy (mkHsTupCon tcName Boxed  ($2:$4)) ($2:$4) }
        | '(#' comma_types1 '#)'        { HsTupleTy (mkHsTupCon tcName Unboxed     $2) $2      }
-       | '[' type ']'                  { HsListTy $2 }
-       | '[:' type ':]'                { HsPArrTy $2 }
-       | '(' ctype ')'                 { $2 }
+       | '[' type ']'                  { HsListTy  $2 }
+       | '[:' type ':]'                { HsPArrTy  $2 }
+       | '(' ctype ')'                 { HsParTy   $2 }
        | '(' ctype '::' kind ')'       { HsKindSig $2 $4 }
 -- Generics
         | INTEGER                       { HsNumTy $1 }
@@ -987,7 +987,7 @@ exp10 :: { RdrNameHsExpr }
        | 'case' srcloc exp 'of' altslist       { HsCase $3 $5 $2 }
        | '-' fexp                              { mkHsNegApp $2 }
        | srcloc 'do' stmtlist                  {% checkDo $3  `thenP` \ stmts ->
-                                                  returnP (HsDo DoExpr stmts $1) }
+                                                  returnP (mkHsDo DoExpr stmts $1) }
 
        | '_ccall_'    ccallid aexps0           { HsCCall $2 $3 PlayRisky False placeHolderType }
        | '_ccall_GC_' ccallid aexps0           { HsCCall $2 $3 (PlaySafe False) False placeHolderType }
@@ -1071,9 +1071,9 @@ list :: { RdrNameHsExpr }
        | exp srcloc pquals             {% let { body [qs] = qs;
                                                 body  qss = [ParStmt (map reverse qss)] }
                                           in
-                                          returnP ( HsDo ListComp
-                                                          (reverse (ResultStmt $1 $2 : body $3))
-                                                          $2
+                                          returnP ( mkHsDo ListComp
+                                                           (reverse (ResultStmt $1 $2 : body $3))
+                                                           $2
                                                  )
                                        }
 
@@ -1113,10 +1113,10 @@ parr :: { RdrNameHsExpr }
                                                           (map reverse qss)]}
                                           in
                                           returnP $ 
-                                            HsDo PArrComp 
-                                                 (reverse (ResultStmt $1 $2 
-                                                           : body $3))
-                                                 $2
+                                            mkHsDo PArrComp 
+                                                   (reverse (ResultStmt $1 $2 
+                                                            : body $3))
+                                                   $2
                                        }
 
 -- We are reusing `lexps' and `pquals' from the list case.