Changeset 5355 for src/Pugs/Compile/Pugs.hs
- Timestamp:
- 07/10/05 12:56:06 (4 years ago)
- svk:copy_cache_prev:
- 7349
- Files:
-
- 1 modified
-
src/Pugs/Compile/Pugs.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Compile/Pugs.hs
r5266 r5355 64 64 , text ("return (Pad " ++ show scope ++ " pad exp)") 65 65 ] 66 compile (Pos pos exp) = compileShow2 "Pos" pos exp 67 compile (Cxt cxt exp) = compileShow2 "Cxt" cxt exp 66 68 compile exp = return $ text "return" $+$ parens (text $ show exp) 69 70 compileShow2 :: Show a => String -> a -> Exp -> Eval Doc 71 compileShow2 con anno exp = do 72 expC <- compile exp 73 return $ prettyDo 74 [ prettyBind "exp" expC 75 , text ("return (" ++ con ++ " " ++ show anno ++ " exp)") 76 ] 67 77 68 78 instance Compile Pad where … … 140 150 $(liftM TH.ListE $ 141 151 mapM (\name -> [|(name, tshow $ 142 $(TH.varE $ TH.mkName name) code )|]) $152 $(TH.varE $ TH.mkName name) code{ subEnv = Nothing })|]) $ 143 153 ["isMulti", "subName", "subType", "subEnv", "subAssoc", 144 154 "subParams", "subBindings", "subSlurpLimit", … … 151 161 #else 152 162 compile code | subType code == SubPrim = return $ text "mkPrim" 153 compile code = return $ text $ show code 163 compile code = return $ text $ show code{ subType = Nothing } 154 164 #endif 155 165
