Changeset 13273 for src/Pugs/Val
- Timestamp:
- 09/13/06 22:55:25 (2 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Val/Code.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Val/Code.hs
r13260 r13273 161 161 162 162 prettyParam :: Param -> Bool -> Bool -> Doc 163 prettyParam p isReq isPos = staticTypes <+> varName <> defaultHint <+> 164 (if haveDefault then equals <+> text "..." else empty) <+> acc <+> ref <+> lazy <+> 165 slots <+> constraints <+> debugDump 163 prettyParam p isReq isPos = staticTypes <+> varName <> defaultHint <+> sep 164 [ traits, unpacking, constraints, debugDump ] 166 165 where 167 166 varName … … 173 172 defaultHint = if not isReq && not haveDefault then text "?" else empty 174 173 haveDefault = isJust $ unDefault $ p_default p 175 acc = case p_hasAccess p of 174 defaultVal = if haveDefault then equals <+> text "..." else empty 175 traits = sep [acc, ref, lazy, slots] 176 unpacking = case p_unpacking p of 177 (Just s) -> purePretty s 178 _ -> empty 179 acc = case p_hasAccess p of 176 180 AccessRO -> empty 177 181 AccessRW -> text "is rw" 178 182 AccessCopy -> text "is copy" 179 ref = if p_isRef p then text "is ref" else empty180 lazy = if p_isLazy p then text "is lazy" else empty183 ref = if p_isRef p then text "is ref" else empty 184 lazy = if p_isLazy p then text "is lazy" else empty 181 185 -- slots = hsep [text ("is " ++ (cast aux)) <+> text "..." | (aux, val) <- Map.toList $ p_slots p] XXX: for when traits have args 182 slots = hsep [text ("is " ++ (cast $ fst trait)) | trait <- Map.toList $ p_slots p]186 slots = hsep [text ("is " ++ (cast $ fst trait)) | trait <- Map.toList $ p_slots p] 183 187 constraints = hsep $ replicate (length $ p_constraints p) (text "where {...}") 184 debugDump = if True then empty else braces $ text $ show p -- XXX delme188 debugDump = if True then empty else braces $ text $ show p -- XXX delme 185 189 -------------------------------------------------------------------------------------- 186 190
