亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? config.hs

?? Haskell是一種程序語言。特別的
?? HS
?? 第 1 頁 / 共 2 頁
字號:
-----------------------------------------------------------------------------
-- |
-- Module      :  Config
-- Copyright   :  Malcolm Wallace
-- 
-- Maintainer  :  Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>
-- Stability   :  Stable
-- Portability :  All
--
-- Handles compiler configuration information, both globally and
-- locally.  Does reading & writing of configuration files, etc.
-----------------------------------------------------------------------------

module Config where

import Compiler
import System (ExitCode(..),exitWith,getEnv)
import Directory (doesFileExist,doesDirectoryExist,createDirectory
                 ,getPermissions,Permissions(..))
import Monad (when)
import List (nub,isPrefixOf)
import Platform (unsafePerformIO,exe,escape,windows)
import RunAndReadStdout (runAndReadStdout, basename, dirname)
import Char (isDigit)
import Monad (foldM)
import IO (stderr)
#ifdef __HBC__
import IOMisc (hPutStrLn)
#else
import IO (hPutStrLn)
#endif


----
data PersonalConfig = PersonalConfig
  { globalConfig :: HmakeConfig
  , localConfig  :: Maybe HmakeConfig
  }

defaultComp :: PersonalConfig -> FilePath
defaultComp conf =
  case localConfig conf of
    Just local -> defaultCompiler local
    Nothing    -> defaultCompiler (globalConfig conf)

knownComps  :: PersonalConfig -> [CompilerConfig]
knownComps conf =
  case localConfig conf of
    Just local -> nub (knownCompilers local ++ globals)
    Nothing    -> globals
  where
    globals = knownCompilers (globalConfig conf)

----
data HmakeConfig = HmakeConfig
  { defaultCompiler :: FilePath
  , knownCompilers  :: [CompilerConfig]
  }
  deriving (Eq,Read)

data CompilerConfig = CompilerConfig
  { compilerStyle      :: HC
  , compilerPath       :: FilePath
  , compilerVersion    :: String
  , includePaths       :: [FilePath]
  , cppSymbols         :: [String]
  , extraCompilerFlags :: [String]
  , isHaskell98        :: Bool
  }
  | DynCompiler { compilerPath :: FilePath }
  deriving (Read)

-- Expand a dynamically-specified compiler by doing the configure step.
unDyn :: CompilerConfig -> IO CompilerConfig
unDyn (DynCompiler path) = configure path
unDyn cc = return cc

instance Eq CompilerConfig where	-- equality on filename only
  cc1 == cc2   =   compilerPath cc1 == compilerPath cc2

instance Show CompilerConfig where
  showsPrec p (DynCompiler hc) =
      showString "DynCompiler { compilerPath = " . shows hc .showString " }\n"
  showsPrec p cc =
      showString "CompilerConfig"
      . showString "\n      { compilerStyle = " . shows (compilerStyle cc)
      . showString "\n      , compilerPath = " . shows (compilerPath cc)
      . showString "\n      , compilerVersion = " . shows (compilerVersion cc)
      . showString "\n      , includePaths = " . showPaths (includePaths cc)
      . showString "\n      , cppSymbols = " . shows (cppSymbols cc)
      . showString "\n      , extraCompilerFlags = "
                                               . shows (extraCompilerFlags cc)
      . showString "\n      , isHaskell98 = " . shows (isHaskell98 cc)
      . showString "\n      }\n"
      where
        showPaths [] = showString "[]"
        showPaths [x] = showChar '[' . shows x . showChar ']'
        showPaths (x:xs) = showString "[" . shows x . showl xs
          where
            showl []     = showChar '\n'
                           . showString (take 23 (repeat ' '))
                           . showChar ']'
            showl (x:xs) = showChar '\n'
                           . showString (take 23 (repeat ' '))
                           . showChar ',' . shows x . showl xs
  showList [] = showString " []"
  showList (x:xs) = showString "\n    [ " . showsPrec 0 x . showl xs
      where showl []     = showString "    ]"
            showl (x:xs) = showString "    , " . showsPrec 0 x . showl xs


instance Show HmakeConfig where
  showsPrec p hmc = showString "HmakeConfig\n  { defaultCompiler = "
                    . shows (defaultCompiler hmc)
                    . showString "\n  , knownCompilers ="
                    . showList (knownCompilers hmc)
                    . showString "\n  }\n"

----
-- | Suck in a single configuration file.  (Uses unsafePerformIO.)
readConfig :: FilePath -> HmakeConfig
readConfig file = unsafePerformIO (safeReadConfig file)

-- | A safe version of "readConfig".  Sucks in a single configuration file,
--   ensuring it parses correctly.
safeReadConfig :: FilePath -> IO HmakeConfig
safeReadConfig file = do
    f <- catch (readFile file)
               (\e-> error ("Config file "++file++" does not exist.\n"
                            ++"  Try running 'hmake-config new' first."))
    config <- saferead file f
    return config
  where
    -- ensure the value read from the file is fully evaluated
    saferead :: FilePath -> String -> IO HmakeConfig
    saferead path s =
        let val = case [x | (x,t) <- reads s, ("","") <- lex t] of
                       [x] -> x
                       []  -> error ("hmake-config: can't parse config file '"
                                     ++ path++"'")
                       _   -> error ("hmake-config: ambiguous parse of config '"
                                     ++ path++"'")
        in (return $! val)

-- | Read the user's complete configuration.
readPersonalConfig :: (FilePath,Maybe FilePath) -- ^ (global, local)
                   -> IO PersonalConfig
readPersonalConfig (global,local) = do
    g <- safeReadConfig global
    l <- case local of
           Just lo -> do l <- safeReadConfig lo
                         return (Just l)
           Nothing -> return Nothing
    return PersonalConfig { globalConfig = g , localConfig  = l }

-- | Use getEnv to find the configuration location.  (Uses unsafePerformIO)
defaultConfigLocation :: Bool -- ^ Create the directory if it doesn't exist.
                      -> (FilePath, Maybe FilePath)
defaultConfigLocation create = unsafePerformIO $ do
    machine <- getEnv "MACHINE"
    global <- getEnv "HMAKECONFDIR"
    let g = global++"/"++machine++"/hmakerc"
    catch (do home <- getEnv "HOME"
              let dir = home ++ "/.hmakerc"
                  loc = dir ++"/"++ machine
              exists <- doesFileExist loc
              if exists
                then return (g, Just loc)
                else if create then
                   do ok <- doesDirectoryExist dir
                      when (not ok) (createDirectory dir)
                      return (g, Just loc)
                else return (g, Nothing))
          (\e-> return (g, Nothing))


matchCompiler :: String -> PersonalConfig -> CompilerConfig
matchCompiler hc conf =
  case localConfig conf of
      Just local -> foldr search global (knownCompilers local)
      Nothing    -> global
  where
      search comp other = if compilerPath comp == hc then comp else other
      global = foldr search
                     (error ("hmake: the compiler '"++hc++"' is not known.\n"))
                     (knownCompilers (globalConfig conf))

compilerKnown :: String -> PersonalConfig -> Bool
compilerKnown hc config =
    any (\comp -> compilerPath comp == hc) known
  where
    known = knownCompilers (globalConfig config) ++
            case localConfig config of
              Just l  -> knownCompilers l
              Nothing -> []

usualCompiler :: PersonalConfig -> CompilerConfig
usualCompiler config = matchCompiler def config
  where def = case localConfig config of
                Just l  -> defaultCompiler l
                Nothing -> defaultCompiler (globalConfig config)


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品一区蜜桃臀影院| 91一区二区三区在线观看| 日韩一区二区在线观看视频| 午夜a成v人精品| 日韩亚洲国产中文字幕欧美| 久久精品国产亚洲aⅴ| 精品日韩欧美在线| 福利91精品一区二区三区| 国产精品系列在线| 在线亚洲高清视频| 免费在线视频一区| 国产亚洲精品7777| 欧美亚洲精品一区| 蜜臀99久久精品久久久久久软件 | 不卡视频在线观看| 亚洲免费观看在线观看| 欧美亚洲综合色| 蜜桃av一区二区| 国产精品乱码人人做人人爱| 在线观看精品一区| 蜜桃av噜噜一区二区三区小说| 久久网站热最新地址| 一本大道av伊人久久综合| 日韩电影免费在线观看网站| 国产区在线观看成人精品| 欧美丝袜丝交足nylons图片| 久久国产精品无码网站| 中文字幕一区二区在线观看| 欧美日韩一区二区三区在线看| 久久精品999| 一区二区三区四区中文字幕| 日韩午夜中文字幕| 色88888久久久久久影院野外| 毛片av一区二区三区| 亚洲色图视频免费播放| 欧美mv日韩mv| 欧美日韩一区三区| 成人av网址在线观看| 麻豆精品视频在线观看视频| 一区在线播放视频| 亚洲精品在线观看网站| 欧美在线观看视频一区二区| 国产mv日韩mv欧美| 青娱乐精品在线视频| 亚洲男同1069视频| 国产日韩欧美a| 精品久久久久久久久久久久包黑料 | 国产亚洲一区二区三区在线观看| 一本到一区二区三区| 国产成人在线观看| 青娱乐精品视频| 亚洲综合男人的天堂| 国产欧美一区二区精品仙草咪| 精品视频999| 色综合久久六月婷婷中文字幕| 国产精品自在欧美一区| 奇米影视一区二区三区| 亚洲电影你懂得| 亚洲欧美另类久久久精品2019 | 亚洲国产成人私人影院tom| 欧美电视剧免费全集观看| 欧美日韩中文国产| av在线不卡电影| 东方aⅴ免费观看久久av| 九九精品视频在线看| 日韩精品一二三| 石原莉奈一区二区三区在线观看| 亚洲精品中文在线| 中文字幕佐山爱一区二区免费| 国产午夜精品在线观看| 国产日韩欧美一区二区三区乱码 | 亚洲欧洲三级电影| 国产精品久久久久一区二区三区共 | 三级在线观看一区二区| 亚洲一区二区视频| 亚洲国产综合色| 亚洲国产综合人成综合网站| 亚洲国产美女搞黄色| 亚洲午夜一区二区| 三级在线观看一区二区| 日韩精品色哟哟| 视频精品一区二区| 蜜桃av一区二区在线观看 | 亚洲第一综合色| 亚洲一区二区在线免费观看视频| 亚洲乱码日产精品bd| 伊人夜夜躁av伊人久久| 亚洲国产婷婷综合在线精品| 一区二区三区中文字幕电影 | 伊人开心综合网| 亚洲午夜精品17c| 亚洲成人一区二区在线观看| 视频一区中文字幕国产| 秋霞成人午夜伦在线观看| 韩国成人在线视频| 岛国一区二区三区| 在线精品国精品国产尤物884a| 欧美午夜在线一二页| 日韩欧美激情在线| 日本一区二区三区在线不卡| 亚洲毛片av在线| 五月婷婷欧美视频| 国产精品一区二区果冻传媒| 成人亚洲一区二区一| 色乱码一区二区三区88| 日韩一级在线观看| 日本一区二区电影| 亚瑟在线精品视频| 国产精品一区专区| 在线观看精品一区| 精品成人一区二区| 亚洲欧美视频一区| 美女网站色91| 91麻豆123| 日韩精品专区在线影院观看| 国产精品国产自产拍在线| 午夜精品一区二区三区免费视频 | 免费欧美高清视频| 从欧美一区二区三区| 欧美日韩日本视频| 欧美高清在线一区| 裸体一区二区三区| 日本高清不卡视频| 久久美女高清视频| 亚洲福利电影网| 成人午夜大片免费观看| 欧美一级片在线| 一区二区不卡在线播放| 国产九色sp调教91| 欧美精品丝袜中出| 中文字幕一区二区三| 免费高清成人在线| 欧美视频在线不卡| 国产精品久久毛片a| 免费精品视频在线| 在线免费观看成人短视频| 日本一区二区三区高清不卡| 蜜臀av在线播放一区二区三区| 91美女视频网站| 国产午夜精品一区二区三区视频 | 不卡视频免费播放| 2017欧美狠狠色| 日日夜夜免费精品| 在线看不卡av| 中文字幕亚洲成人| 国产精品亚洲一区二区三区在线| 欧美一区二区三区不卡| 亚洲成人黄色小说| 欧美综合一区二区| 樱花影视一区二区| 91亚洲精品乱码久久久久久蜜桃| 欧美tickling网站挠脚心| 婷婷久久综合九色综合伊人色| 色先锋资源久久综合| 国产精品美女一区二区| 岛国一区二区在线观看| 国产午夜亚洲精品不卡| 国产精品一级片| 国产亚洲美州欧州综合国| 另类调教123区| 欧美zozozo| 国内精品国产成人国产三级粉色| 欧美一区二区视频观看视频| 亚洲国产精品一区二区久久| 欧美在线不卡视频| 亚洲国产wwwccc36天堂| 日本精品视频一区二区三区| 亚洲视频在线一区二区| 99精品欧美一区二区三区综合在线| 国产精品午夜在线| 91在线高清观看| 亚洲激情校园春色| 欧美婷婷六月丁香综合色| 亚洲精选视频在线| 欧美视频中文字幕| 三级不卡在线观看| 欧美精品一区二区三区久久久| 久草在线在线精品观看| 2021国产精品久久精品| 成人免费视频网站在线观看| 最新热久久免费视频| 欧美中文一区二区三区| 日本视频一区二区三区| 精品国产不卡一区二区三区| 国产suv一区二区三区88区| 亚洲天堂久久久久久久| 欧美三日本三级三级在线播放| 日本欧洲一区二区| 欧美激情一区三区| 色婷婷精品大视频在线蜜桃视频| 亚洲狠狠爱一区二区三区| 日韩欧美国产三级电影视频| 精品一区二区三区免费观看| 国产欧美一二三区| 91福利在线导航| 毛片av一区二区| 国产精品福利av| 欧美日韩一区二区三区在线 | thepron国产精品| 亚洲一区二区av电影|