{- -*-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.
| 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 }
| '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 }
| 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
)
}
(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.