blob: 7a6d9de2228216d8d6bd6790c51f5250a5636006 (
plain) (
blame)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
module Main where
import Options.Applicative
import Config ( ArgMode(..)
, Args(..)
)
import Eval
mode :: Parser ArgMode
mode =
flag' ArgEvalBblc
(long "eval-bblc" <> short 'e' <> help "Evaluate file with BLC bits")
<|> flag'
ArgEvalBlc
(long "eval-blc" <> short 'E' <> help "Evaluate file with ASCII BLC")
<|> flag' ArgDumpBblc
(long "dump-bblc" <> short 'b' <> help "Dump file as BLC bits")
<|> flag' ArgDumpBlc
(long "dump-blc" <> short 'B' <> help "Dump file as ASCII BLC")
args :: Parser Args
args =
Args
<$> (mode <|> pure ArgEval)
<*> switch (long "yolo" <> short 'y' <> help "Don't run tests")
<*> switch (long "verbose" <> short 'v' <> help "Increase verbosity")
<*> switch
(long "optimize" <> short 'O' <> help
"Optimize program (abstraction of duplicated terms)"
)
<*> strOption
(long "target" <> short 't' <> metavar "TARGET" <> value "" <> help
"Compile to target using BLoC and BLoCade"
)
<*> strOption
( long "reducer"
<> short 'r'
<> metavar "REDUCER"
<> value "HigherOrder"
<> help "Reducer (currently RKNL, ION, or HigherOrder)"
)
<*> optional (argument str (metavar "PATH" <> help "Path to file"))
main :: IO ()
main = evalMain =<< execParser opts
where
opts =
info (args <**> helper) (fullDesc <> header "bruijn programming language")
|