@@ -50,7 +50,7 @@ data ReplOpts = ReplOpts
5050 initialState = ReplOpts
5151 { prompt = "frege> "
5252 , multilinePrompt = "> "
53- , showLimit = 80
53+ , showLimit = 800
5454 }
5555
5656data Repl a = Repl { un :: StateT ReplEnv IO a } where
@@ -228,29 +228,37 @@ eval (Set s) | Just (Just limitStr : _) <- s `match` 'show-limit\s+(.+)' =
228228 errInfo = ReplInfo [Message. error $ " show-limit value must be a positive integer below " ++ show (maxBound :: Int )]
229229 either invalidNumber updateOpts limitStr. int
230230
231- eval (Set " v" ) = parseAndSetCompilerFlag " -v"
232- eval (Set " hints" ) = parseAndSetCompilerFlag " -hints"
233- eval (Set " nowarn" ) = parseAndSetCompilerFlag " -nowarn"
234- eval (Set " inline" ) = parseAndSetCompilerFlag " -inline"
235- eval (Set " O" ) = parseAndSetCompilerFlag " -O"
236- eval (Set " comments" ) = parseAndSetCompilerFlag " -comments"
237- eval (Set " ascii" ) = parseAndSetCompilerFlag " -ascii"
238- eval (Set " greek" ) = parseAndSetCompilerFlag " -greek"
239- eval (Set " fraktur" ) = parseAndSetCompilerFlag " -fraktur"
240- eval (Set " latin" ) = parseAndSetCompilerFlag " -latin"
241- eval (Set unknown) = return $ ReplInfo [Message. error (" Invalid option: " ++ unknown)]
242-
243- eval (Unset " v" ) = clearCompilerFlag Flag. VERBOSE
244- eval (Unset " hints" ) = clearCompilerFlag Flag. HINTS
245- eval (Unset " nowarn" ) = setCompilerFlag Flag. WARNINGS
246- eval (Unset " inline" ) = clearCompilerFlag Flag. INLINE
247- eval (Unset " O" ) = clearCompilerFlag Flag. OPTIMIZE
248- eval (Unset " comments" ) = clearCompilerFlag Flag. COMMENTS
249- eval (Unset " ascii" ) = setCompilerFlag Flag. USEUNICODE
250- eval (Unset " greek" ) = clearCompilerFlag Flag. USEGREEK
251- eval (Unset " fraktur" ) = clearCompilerFlag Flag. USEFRAKTUR
252- eval (Unset " latin" ) = clearCompilerFlag Flag. USEGREEK >> clearCompilerFlag Flag. USEFRAKTUR
253- eval (Unset unknown) = return $ ReplInfo [Message. error (" Invalid option: " ++ unknown)]
231+ -- eval (Set "v") = parseAndSetCompilerFlag "-v"
232+ -- eval (Set "hints") = parseAndSetCompilerFlag "-hints"
233+ -- eval (Set "nowarn") = parseAndSetCompilerFlag "-nowarn"
234+ -- eval (Set "inline") = parseAndSetCompilerFlag "-inline"
235+ -- eval (Set "O") = parseAndSetCompilerFlag "-O"
236+ -- eval (Set "comments") = parseAndSetCompilerFlag "-comments"
237+ -- eval (Set "ascii") = parseAndSetCompilerFlag "-ascii"
238+ -- eval (Set "greek") = parseAndSetCompilerFlag "-greek"
239+ -- eval (Set "fraktur") = parseAndSetCompilerFlag "-fraktur"
240+ -- eval (Set "latin") = parseAndSetCompilerFlag "-latin"
241+ -- eval (Set unknown) = return $ ReplInfo [Message.error ("Invalid option: " ++ unknown)]
242+ eval (Set '^-? explain') = setCompilerFlag Flag. EXPLAIN
243+ eval (Set something) = if something. startsWith " -"
244+ then parseAndSetCompilerFlag something
245+ else parseAndSetCompilerFlag (" -" ++ something)
246+
247+ eval (Unset '^-? v$ ') = clearCompilerFlag Flag. VERBOSE
248+ eval (Unset '^-? hints$ ') = clearCompilerFlag Flag. HINTS
249+ eval (Unset '^-? nowarn$ ') = setCompilerFlag Flag. WARNINGS
250+ eval (Unset '^-? inline$ ') = clearCompilerFlag Flag. INLINE
251+ eval (Unset '^-? O $ ') = clearCompilerFlag Flag. OPTIMIZE >> clearCompilerFlag Flag. INLINE
252+ eval (Unset '^-? comments$ ') = clearCompilerFlag Flag. COMMENTS
253+ eval (Unset '^-? ascii$ ') = setCompilerFlag Flag. USEUNICODE
254+ eval (Unset '^-? greek$ ') = clearCompilerFlag Flag. USEGREEK
255+ eval (Unset '^-? fraktur$ ') = clearCompilerFlag Flag. USEFRAKTUR
256+ eval (Unset '^-? latin$ ') = clearCompilerFlag Flag. USEGREEK >> clearCompilerFlag Flag. USEFRAKTUR
257+ eval (Unset '^-? explain') = clearCompilerFlag Flag. EXPLAIN
258+ eval (Unset '^-? x') = do
259+ forM_ [Flag. TRACE1 .. Flag. TRACEZ ] clearCompilerFlag
260+ pure (ReplInfo [Message. info " all trace flags cleared" ])
261+ eval (Unset unknown) = pure (ReplInfo [Message. error (" Invalid option: " ++ unknown)])
254262
255263eval History = do
256264 env <- Repl. get
@@ -358,7 +366,7 @@ urlContents url = do
358366 scanner. next `finally` scanner. close
359367
360368fileContents filePath = do
361- file <- File. new filePath
369+ let file = File. new filePath :: File
362370 scanner <- Scanner. new file " utf-8"
363371 scanner. useDelimiter '\ Z'
364372 scanner. next `finally` scanner. close
0 commit comments