-dsExpr (HsLitOut (HsString str) _)
- = returnDs (mkStringLitFS str)
-
-dsExpr (HsLitOut (HsLitLit str) ty)
- = ASSERT( maybeToBool maybe_ty )
- returnDs (wrap_fn (mkLit (MachLitLit str rep_ty)))
- where
- (maybe_ty, wrap_fn) = resultWrapper ty
- Just rep_ty = maybe_ty
-
-dsExpr (HsLitOut (HsInt i) ty)
- = returnDs (mkIntegerLit i)
-
-
-dsExpr (HsLitOut (HsFrac r) ty)
- = returnDs (mkConApp ratio_data_con [Type integer_ty,
- mkIntegerLit (numerator r),
- mkIntegerLit (denominator r)])
- where
- (ratio_data_con, integer_ty)
- = case (splitAlgTyConApp_maybe ty) of
- Just (tycon, [i_ty], [con])
- -> ASSERT(isIntegerTy i_ty && getUnique tycon == ratioTyConKey)
- (con, i_ty)
-
- _ -> (panic "ratio_data_con", panic "integer_ty")
-
-
-
--- others where we know what to do:
-
-dsExpr (HsLitOut (HsIntPrim i) _)
- = returnDs (mkIntLit i)
-
-dsExpr (HsLitOut (HsFloatPrim f) _)
- = returnDs (mkLit (MachFloat f))
-
-dsExpr (HsLitOut (HsDoublePrim d) _)
- = returnDs (mkLit (MachDouble d))
- -- ToDo: range checking needed!
-
-dsExpr (HsLitOut (HsChar c) _)
- = returnDs ( mkConApp charDataCon [mkLit (MachChar c)] )
-
-dsExpr (HsLitOut (HsCharPrim c) _)
- = returnDs (mkLit (MachChar c))
-
-dsExpr (HsLitOut (HsStringPrim s) _)
- = returnDs (mkLit (MachStr s))
-
--- end of literals magic. --