~gcrosswhite/privateer/1.0

« back to all changes in this revision

Viewing changes to src/Common.hs

  • Committer: Gregory Crosswhite
  • Date: 2009-04-20 23:22:32 UTC
  • Revision ID: gcross@phys.washington.edu-20090420232232-ph1u9fmudz66pylp
 Modified the code to use the stream fusion library, and also to kill lines in the source starting with "#" so that they don't confuse the parser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
-- @<< Imports >>
10
10
-- @+node:gcross.20090205185536.3:<< Imports >>
 
11
import Prelude hiding ((++))
 
12
 
11
13
import Language.C
12
14
import Data.Map
13
15
import Data.Sequence
14
16
import Data.Data
15
17
import Data.Generics
16
 
import Data.List
17
 
import qualified Data.List as List
 
18
import Data.List.Stream
 
19
import qualified Data.List.Stream as List
18
20
 
19
21
import Text.PrettyPrint
20
22
-- @nonl
113
115
-- @+node:gcross.20090127221948.4:extractStorage
114
116
extractStorage :: [CDeclSpec] -> (Maybe CStorageSpec, [CDeclSpec])
115
117
extractStorage specs =
116
 
    let (storage_specs, rest_specs) = Data.List.partition storageFilter specs
 
118
    let (storage_specs, rest_specs) = List.partition storageFilter specs
117
119
        maybe_storage_spec =
118
120
            case storage_specs of
119
121
                [] -> Nothing