Changeset 10745 for src/Pugs/Compile.hs

Show
Ignore:
Timestamp:
06/19/06 15:14:14 (2 years ago)
Author:
audreyt
Message:

* Update PIL Compiler to deal with this:

($x) = 1,2,3

to parse as list. Currently use a horrible (Sym SMy "") form
for the lack of a better Noop annotation node.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Compile.hs

    r10460 r10745  
    141141 
    142142instance Compile Exp PIL_Stmts where 
    143     compile (Ann (Pos _) rest) = compile rest -- fmap (PPos pos rest) $ compile rest 
     143    -- XXX: pragmas? 
     144    compile (Ann Pos{} rest) = compile rest -- fmap (PPos pos rest) $ compile rest 
     145    compile (Ann Prag{} rest) = compile rest -- fmap (PPos pos rest) $ compile rest 
    144146    compile (Ann (Cxt cxt) rest) = enter cxt $ compile rest 
    145     -- XXX: pragmas? 
     147    compile (Sym _ "" rest) = compile rest 
    146148    compile (Stmts (Pad SOur _ exp) rest) = do 
    147149        compile $ mergeStmts exp rest 
     
    202204    compile (Ann (Cxt cxt) rest) = enter cxt $ compile rest 
    203205    -- XXX: pragmas? 
     206    compile (Ann Prag{} rest) = compile rest -- fmap (PPos pos rest) $ compile rest 
     207    compile (Sym _ "" rest) = compile rest 
    204208    compile Noop = return PNoop 
    205209    compile (Val val) = do 
     
    274278 
    275279instance Compile Exp PIL_LValue where 
    276     compile (Ann (Pos _) rest) = compile rest -- fmap (PPos pos rest) $ compile rest 
     280    compile (Ann Pos{} rest) = compile rest -- fmap (PPos pos rest) $ compile rest 
     281    compile (Ann Prag{} rest) = compile rest 
    277282    compile (Ann (Cxt cxt) rest) = enter cxt $ compile rest 
     283    compile (Sym _ "" rest) = compile rest 
    278284    -- XXX: pragmas? 
    279285    compile (Var name) = return $ PVar name 
     
    370376{-| Compiles various 'Exp's to 'PIL_Expr's. -} 
    371377instance Compile Exp PIL_Expr where 
    372     compile (Ann (Pos _) rest) = compile rest -- fmap (PPos pos rest) $ compile rest 
     378    compile (Ann Pos{} rest) = compile rest -- fmap (PPos pos rest) $ compile rest 
     379    compile (Ann Prag{} rest) = compile rest 
    373380    compile (Ann (Cxt cxt) rest) = enter cxt $ compile rest 
     381    compile (Sym _ "" rest) = compile rest 
    374382    -- XXX: pragmas? 
    375383    compile (Var name) = return . PExp $ PVar name