Changeset 2462 for src/Pugs/External.hs

Show
Ignore:
Timestamp:
04/29/05 14:33:31 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
3914
Message:

* rewrote position handling and statement reduction logic.
* much better error message -- now with source ranges

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/External.hs

    r2458 r2462  
    1616 
    1717externalize :: String -> Exp -> IO String 
    18 externalize mod (Stmts stmts) = externExternalize backend mod code 
     18externalize mod stmts = externExternalize backend mod code 
    1919    where 
    2020    (backend, code) 
     
    2323        | otherwise     = error "multiple inline found" 
    2424    things = [ (backend, code) 
    25              | (Syn "inline" [Val (VStr backend), Val (VStr code)], _) <- stmts 
     25             | (Syn "inline" [Val (VStr backend), Val (VStr code)]) <- flatten stmts 
    2626             ] 
    27 externalize _ _ = error "not statements" 
     27    flatten (Stmts cur rest) = (cur:flatten rest) 
     28    flatten exp = [exp] 
     29 
    2830 
    2931externExternalize "Haskell" = externalizeHaskell