X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fparser%2FParser.y;h=ea8f6f51d28e54212120a1b812832a25d037cf32;hb=2205f0ceeb65d8acb7db953bf4fd2ad673dc55ee;hp=6c0fccb0f5227549c53c455910628b5a273f96ea;hpb=ef2b170c6298b4826d3b56465a3c1438b5be7307;p=ghc-hetmet.git diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y index 6c0fccb..ea8f6f5 100644 --- a/ghc/compiler/parser/Parser.y +++ b/ghc/compiler/parser/Parser.y @@ -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.