Changeset 8153 for src/Pugs/Compile
- Timestamp:
- 12/10/05 13:24:15 (3 years ago)
- Location:
- src/Pugs/Compile
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Compile/Haskell.hs
r5890 r8153 65 65 argC1 = compile arg1 66 66 argC2 = compile arg2 67 compile (Cxt _ arg) = compile arg 68 compile (Pos _ arg) = compile arg 67 compile (Ann _ arg) = compile arg 69 68 compile (Val (VInt i)) = [| return (VInt i) |] 70 69 compile (Val (VStr s)) = [| return (VStr s) |] -
src/Pugs/Compile/PIL2.hs
r7866 r8153 128 128 129 129 instance Compile Exp PIL_Stmts where 130 compile (Pos _ rest) = compile rest -- fmap (PPos pos rest) $ compile rest 131 compile (Cxt cxt rest) = enter cxt $ compile rest 130 compile (Ann (Pos _) rest) = compile rest -- fmap (PPos pos rest) $ compile rest 131 compile (Ann (Cxt cxt) rest) = enter cxt $ compile rest 132 -- XXX: pragmas? 132 133 compile (Stmts (Pad SOur _ exp) rest) = do 133 134 compile $ mergeStmts exp rest … … 183 184 184 185 instance Compile Exp PIL_Stmt where 185 compile (Pos pos rest) = fmap (PPos pos rest) $ compile rest 186 compile (Cxt cxt rest) = enter cxt $ compile rest 186 compile (Ann (Pos pos) rest) = fmap (PPos pos rest) $ compile rest 187 compile (Ann (Cxt cxt) rest) = enter cxt $ compile rest 188 -- XXX: pragmas? 187 189 compile Noop = return PNoop 188 190 compile (Val val) = do … … 257 259 258 260 instance Compile Exp PIL_LValue where 259 compile ( Pos _rest) = compile rest -- fmap (PPos pos rest) $ compile rest260 compile ( Cxt cxtrest) = enter cxt $ compile rest261 compile (Ann (Pos _) rest) = compile rest -- fmap (PPos pos rest) $ compile rest 262 compile (Ann (Cxt cxt) rest) = enter cxt $ compile rest 261 263 compile (Var name) = return $ PVar name 262 264 compile (Syn (sigil:"::()") exps) = do … … 352 354 {-| Compiles various 'Exp's to 'PIL_Expr's. -} 353 355 instance Compile Exp PIL_Expr where 354 compile ( Pos _rest) = compile rest -- fmap (PPos pos rest) $ compile rest355 compile ( Cxt cxtrest) = enter cxt $ compile rest356 compile (Ann (Pos _) rest) = compile rest -- fmap (PPos pos rest) $ compile rest 357 compile (Ann (Cxt cxt) rest) = enter cxt $ compile rest 356 358 compile (Var name) = return . PExp $ PVar name 357 359 compile exp@(Val (VCode _)) = compile $ Syn "sub" [exp] -
src/Pugs/Compile/Pugs.hs
r7843 r8153 61 61 , text "return" <+> parens (text $ "Syn " ++ show syn ++ " exps") 62 62 ] 63 compile (Cxt cxt exp) = compileShow2 "Cxt" cxt exp 64 compile (Pos pos exp) = compileShow2 "Pos" pos exp 63 compile (Ann (Cxt cxt) exp) = compileShow2 "Cxt" cxt exp 64 compile (Ann (Pos pos) exp) = compileShow2 "Pos" pos exp 65 compile (Ann (Prag prag) exp) = compileShow2 "Prag" prag exp 65 66 compile (Pad scope pad exp) = do 66 67 padC <- compile pad
