Changeset 3352 for src/Pugs/Compile/Parrot.hs
- Timestamp:
- 05/17/05 20:00:18 (4 years ago)
- svk:copy_cache_prev:
- 4908
- Files:
-
- 1 modified
-
src/Pugs/Compile/Parrot.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Compile/Parrot.hs
r3350 r3352 45 45 compile = return 46 46 47 padSort ((a::[Char]), [(_, _)]) ((b::[Char]), [(_, _)]) | (head a == ':' && head b == '&') = LT 48 | (head b == ':' && head a == '&') = GT 49 | otherwise = GT 47 padSort ((a::[Char]), [(_, _)]) ((b::[Char]), [(_, _)]) 48 | (head a == ':' && head b == '&') = LT 49 | (head b == ':' && head a == '&') = GT 50 | otherwise = GT 50 51 padSort _ _ = EQ 51 52 52 53 instance Compile Pad where 54 {- XXX The padSort will misplace multiple namespaces in the same pad. 55 We *should* compile the namespaces & subs in order of declaration. 56 -} 53 57 compile pad = do 54 -- fmap vcat $ mapM compile (filter (\((p), [(_, _)]) -> head p == ':') $ padToList pad)55 58 fmap vcat $ mapM compile (sortBy padSort $ padToList pad) 56 59
