Plain source file: base/parse2/ParserOptions.hs (2005-10-11)

ParserOptions is imported by: PFE0.

module ParserOptions where

data Flags
  = Flags {
      prel::Bool,       -- Should all modules implicitly import Prelude?
      plogic::Bool,     -- Recognize extra keywords for Plogic?
      cpp::Maybe String -- Should the C preprocessor be used?
    deriving (Eq,Show,Read)

flags0 = Flags True True Nothing
cpp1= "/lib/cpp -traditional -P -D__HASKELL98__ -D__PFE__"

parserOptions flags args =
  case args of
    "noprelude":args         -> parserOptions flags{prel=False   } args
    "prelude"  :args         -> parserOptions flags{prel=True    } args
    "noplogic" :args         -> parserOptions flags{plogic=False } args
    "plogic"   :args         -> parserOptions flags{plogic=True  } args
    "cpp"      :args         -> parserOptions flags{cpp=Just cpp1} args
    ('c':'p':'p':'=':s):args -> parserOptions flags{cpp=Just s   } args
    "nocpp"    :args         -> parserOptions flags{cpp=Nothing  } args
    _                        -> (flags,args)


(HTML for this module was generated on 2006-08-12. About the conversion tool.)