@@ -6,6 +6,7 @@ License : NCSA
6
6
7
7
module Kore.OptionsParser
8
8
( enableDisableFlag
9
+ , PatternOptions (.. )
9
10
, KoreParserOptions (.. )
10
11
, commandLineParser
11
12
) where
@@ -57,7 +58,7 @@ data PatternOptions = PatternOptions
57
58
}
58
59
59
60
-- | Main options record
60
- data KoreParserOptions' = KoreParserOptions'
61
+ data KoreParserOptions = KoreParserOptions
61
62
{ fileName :: ! FilePath
62
63
-- ^ Name for a file containing a definition to parse and verify
63
64
, patternOpt :: ! (Maybe PatternOptions )
@@ -72,21 +73,10 @@ data KoreParserOptions' = KoreParserOptions'
72
73
-- ^ Option to print in applicative Kore syntax
73
74
}
74
75
75
-
76
- data KoreParserOptions = KoreParserOptions
77
- { fileName :: ! FilePath
78
- , patternFileName :: ! FilePath
79
- , mainModuleName :: ! Text
80
- , willPrintDefinition :: ! Bool
81
- , willPrintPattern :: ! Bool
82
- , willVerify :: ! Bool
83
- , appKore :: ! Bool
84
- }
85
-
86
76
-- | Command Line Argument Parser
87
- commandLineParser' :: Parser KoreParserOptions'
88
- commandLineParser' =
89
- KoreParserOptions'
77
+ commandLineParser :: Parser KoreParserOptions
78
+ commandLineParser =
79
+ KoreParserOptions
90
80
<$> argument str
91
81
( metavar " FILE"
92
82
<> help " Kore source file to parse [and verify]" )
@@ -120,44 +110,3 @@ commandLineParser' =
120
110
( " printing parsed definition in applicative Kore syntax "
121
111
++ " [default disabled]"
122
112
)
123
-
124
- -- TODO (MirceaS): Refactor the code that uses the
125
- -- command line parser so that it uses the new
126
- -- KoreParserOptions options type so that we may
127
- -- remove the terms below
128
-
129
- morph :: KoreParserOptions' -> KoreParserOptions
130
- morph kpo
131
- | Nothing <- patternOpt = KoreParserOptions
132
- { fileName
133
- , patternFileName = " "
134
- , mainModuleName = " "
135
- , willPrintDefinition
136
- , willPrintPattern
137
- , willVerify
138
- , appKore
139
- }
140
- | Just PatternOptions
141
- { patternFileName
142
- , mainModuleName
143
- } <- patternOpt = KoreParserOptions
144
- { fileName
145
- , patternFileName
146
- , mainModuleName
147
- , willPrintDefinition
148
- , willPrintPattern
149
- , willVerify
150
- , appKore
151
- }
152
- where
153
- KoreParserOptions'
154
- { fileName
155
- , patternOpt
156
- , willPrintDefinition
157
- , willPrintPattern
158
- , willVerify
159
- , appKore
160
- } = kpo
161
-
162
- commandLineParser :: Parser KoreParserOptions
163
- commandLineParser = morph <$> commandLineParser'
0 commit comments