Added an option to disable the garbage collector (this feature is not implemented fully yet.).
This commit is contained in:
parent
38b88d36b5
commit
ddffe7913c
2 changed files with 13 additions and 1 deletions
6
Justfile
6
Justfile
|
|
@ -27,3 +27,9 @@ hmd FILE:
|
||||||
|
|
||||||
bid FILE:
|
bid FILE:
|
||||||
cabal run language -- -d -t bi {{FILE}}
|
cabal run language -- -d -t bi {{FILE}}
|
||||||
|
|
||||||
|
hmdm FILE:
|
||||||
|
cabal run language -- -d -t hm -m {{FILE}}
|
||||||
|
|
||||||
|
bidm FILE:
|
||||||
|
cabal run language -- -d -t bi -m {{FILE}}
|
||||||
|
|
@ -65,6 +65,7 @@ flags :: [OptDescr (Options -> Options)]
|
||||||
flags =
|
flags =
|
||||||
[ Option ['d'] ["debug"] (NoArg enableDebug) "Print debug messages."
|
[ Option ['d'] ["debug"] (NoArg enableDebug) "Print debug messages."
|
||||||
, Option ['t'] ["type-checker"] (ReqArg chooseTypechecker "bi/hm") "Choose type checker. Possible options are bi and hm"
|
, Option ['t'] ["type-checker"] (ReqArg chooseTypechecker "bi/hm") "Choose type checker. Possible options are bi and hm"
|
||||||
|
, Option ['m'] ["disable-gc"] (NoArg disableGC) "Disables the garbage collector and uses malloc instead."
|
||||||
, Option [] ["help"] (NoArg enableHelp) "Print this help message"
|
, Option [] ["help"] (NoArg enableHelp) "Print this help message"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -73,6 +74,7 @@ initOpts =
|
||||||
Options
|
Options
|
||||||
{ help = False
|
{ help = False
|
||||||
, debug = False
|
, debug = False
|
||||||
|
, gc = True
|
||||||
, typechecker = Nothing
|
, typechecker = Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,6 +84,9 @@ enableHelp opts = opts{help = True}
|
||||||
enableDebug :: Options -> Options
|
enableDebug :: Options -> Options
|
||||||
enableDebug opts = opts{debug = True}
|
enableDebug opts = opts{debug = True}
|
||||||
|
|
||||||
|
disableGC :: Options -> Options
|
||||||
|
disableGC opts = opts{gc = False}
|
||||||
|
|
||||||
chooseTypechecker :: String -> Options -> Options
|
chooseTypechecker :: String -> Options -> Options
|
||||||
chooseTypechecker s options = options{typechecker = tc}
|
chooseTypechecker s options = options{typechecker = tc}
|
||||||
where
|
where
|
||||||
|
|
@ -93,6 +98,7 @@ chooseTypechecker s options = options{typechecker = tc}
|
||||||
data Options = Options
|
data Options = Options
|
||||||
{ help :: Bool
|
{ help :: Bool
|
||||||
, debug :: Bool
|
, debug :: Bool
|
||||||
|
, gc :: Bool
|
||||||
, typechecker :: Maybe TypeChecker
|
, typechecker :: Maybe TypeChecker
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue