forked from purescript/purescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptions.hs
More file actions
34 lines (28 loc) · 904 Bytes
/
Options.hs
File metadata and controls
34 lines (28 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-- | The data type of compiler options
module Language.PureScript.Options where
import Prelude
import Data.Set qualified as S
import Data.Map (Map)
import Data.Map qualified as Map
-- | The data type of compiler options
data Options = Options
{ optionsVerboseErrors :: Bool
-- ^ Verbose error message
, optionsNoComments :: Bool
-- ^ Remove the comments from the generated js
, optionsCodegenTargets :: S.Set CodegenTarget
-- ^ Codegen targets (JS, CoreFn, etc.)
, optionsFFIExts :: S.Set String
} deriving Show
-- Default make options
defaultOptions :: Options
defaultOptions = Options False False (S.singleton JS) (S.singleton "js")
data CodegenTarget = JS | JSSourceMap | CoreFn | Docs
deriving (Eq, Ord, Show)
codegenTargets :: Map String CodegenTarget
codegenTargets = Map.fromList
[ ("js", JS)
, ("sourcemaps", JSSourceMap)
, ("corefn", CoreFn)
, ("docs", Docs)
]