-------------------------------------
Fix parsing of floating-point constants in External Core
-------------------------------------
This fix accidentally made it into the previous (unrelated) commit,
so it's really the *previous* change to LexCore you should look
at.
The fix updates LexCore so that it can parse literals in scientific
notation (e.g. 4.3e-3)
repE (HsApp x y) = do {a <- repE x; b <- repE y; repApp a b}
repE (OpApp e1 op fix e2) =
repE (HsApp x y) = do {a <- repE x; b <- repE y; repApp a b}
repE (OpApp e1 op fix e2) =
- case op of
- HsVar op -> do { arg1 <- repE e1;
- arg2 <- repE e2;
- the_op <- lookupOcc op ;
- repInfixApp arg1 the_op arg2 }
- _ -> panic "DsMeta.repE: Operator is not a variable"
+ do { arg1 <- repE e1;
+ arg2 <- repE e2;
+ the_op <- repE op ;
+ repInfixApp arg1 the_op arg2 }
repE (NegApp x nm) = do
a <- repE x
negateVar <- lookupOcc negateName >>= repVar
repE (NegApp x nm) = do
a <- repE x
negateVar <- lookupOcc negateName >>= repVar
repSigExp :: Core M.Expr -> Core M.Type -> DsM (Core M.Expr)
repSigExp (MkC e) (MkC t) = rep2 sigExpName [e,t]
repSigExp :: Core M.Expr -> Core M.Type -> DsM (Core M.Expr)
repSigExp (MkC e) (MkC t) = rep2 sigExpName [e,t]
-repInfixApp :: Core M.Expr -> Core String -> Core M.Expr -> DsM (Core M.Expr)
+repInfixApp :: Core M.Expr -> Core M.Expr -> Core M.Expr -> DsM (Core M.Expr)
repInfixApp (MkC x) (MkC y) (MkC z) = rep2 infixAppName [x,y,z]
repSectionL :: Core M.Expr -> Core M.Expr -> DsM (Core M.Expr)
repInfixApp (MkC x) (MkC y) (MkC z) = rep2 infixAppName [x,y,z]
repSectionL :: Core M.Expr -> Core M.Expr -> DsM (Core M.Expr)
-repSectionL (MkC x) (MkC y) = rep2 infixAppName [x,y]
+repSectionL (MkC x) (MkC y) = rep2 sectionLName [x,y]
repSectionR :: Core M.Expr -> Core M.Expr -> DsM (Core M.Expr)
repSectionR :: Core M.Expr -> Core M.Expr -> DsM (Core M.Expr)
-repSectionR (MkC x) (MkC y) = rep2 infixAppName [x,y]
+repSectionR (MkC x) (MkC y) = rep2 sectionRName [x,y]
------------ Right hand sides (guarded expressions) ----
repGuarded :: Core [(M.Expr, M.Expr)] -> DsM (Core M.Rihs)
------------ Right hand sides (guarded expressions) ----
repGuarded :: Core [(M.Expr, M.Expr)] -> DsM (Core M.Rihs)
cvt (ArithSeq dd) = ArithSeqIn (cvtdd dd)
cvt (ListExp xs) = ExplicitList void (map cvt xs)
cvt (Infix (Just x) s (Just y))
cvt (ArithSeq dd) = ArithSeqIn (cvtdd dd)
cvt (ListExp xs) = ExplicitList void (map cvt xs)
cvt (Infix (Just x) s (Just y))
- = HsPar (OpApp (cvt x) (HsVar(vName s)) undefined (cvt y))
-cvt (Infix Nothing s (Just y)) = SectionR (HsVar(vName s)) (cvt y)
-cvt (Infix (Just x) s Nothing ) = SectionL (cvt x) (HsVar(vName s))
-cvt (Infix Nothing s Nothing ) = HsVar(vName s) -- Can I indicate this is an infix thing?
+ = HsPar (OpApp (cvt x) (cvt s) undefined (cvt y))
+cvt (Infix Nothing s (Just y)) = SectionR (cvt s) (cvt y)
+cvt (Infix (Just x) s Nothing ) = SectionL (cvt x) (cvt s)
+cvt (Infix Nothing s Nothing ) = cvt s -- Can I indicate this is an infix thing?
cvt (SigExp e t) = ExprWithTySig (cvt e) (cvtType t)
cvtdecs :: [Meta.Dec] -> HsBinds RdrName
cvt (SigExp e t) = ExprWithTySig (cvt e) (cvtType t)
cvtdecs :: [Meta.Dec] -> HsBinds RdrName