on master help sign in
Add support for :set warnreach.
commit10509f61fab9adb920dd16dec0348abcbe08a57f authorMatus Tejiscak <ziman@functor.sk> dateMon 5 May 2014, 10:25 (12 years ago) parent992e753
3 files changed+13
src/Idris/ASTUtils.hs+9 src/Idris/REPL.hs+3 src/Idris/REPLParser.hs+1
src/Idris/ASTUtils.hs+9
@@ -123,3 +123,12 @@ ist_callgraph n =
123123-- some fields of the CGInfo record
124124cg_usedpos :: Field CGInfo [(Int, [UsageReason])]
125125cg_usedpos = Field usedpos (\v cg -> cg{ usedpos = v })
126+
127+
128+-- Commandline flags
129+--------------------
130+
131+opts_idrisCmdline :: Field IState [Opt]
132+opts_idrisCmdline =
133+ Field opt_cmdline (\v opts -> opts{ opt_cmdline = v })
134+ . Field idris_options (\v ist -> ist{ idris_options = v })
src/Idris/REPL.hs+3
@@ -4,6 +4,7 @@
44module Idris.REPL where
55
66import Idris.AbsSyntax
7+import Idris.ASTUtils
78import Idris.Apropos (apropos)
89import Idris.REPLParser
910import Idris.ElabDecls
@@ -1032,6 +1033,8 @@ process h fn (SetOpt AutoSolve) = setAutoSolve True
10321033process h fn (UnsetOpt AutoSolve) = setAutoSolve False
10331034process h fn (SetOpt NoBanner) = setNoBanner True
10341035process h fn (UnsetOpt NoBanner) = setNoBanner False
1036+process h fn (SetOpt WarnReach) = fmodifyState opts_idrisCmdline $ nub . (WarnReach:)
1037+process h fn (UnsetOpt WarnReach) = fmodifyState opts_idrisCmdline $ delete WarnReach
10351038
10361039process h fn (SetOpt _) = iPrintError "Not a valid option"
10371040process h fn (UnsetOpt _) = iPrintError "Not a valid option"
src/Idris/REPLParser.hs+1
@@ -120,6 +120,7 @@ pOption = do discard (P.symbol "errorcontext"); return ErrContext
120120 <|> do discard (P.symbol "originalerrors"); return ShowOrigErr
121121 <|> do discard (P.symbol "autosolve"); return AutoSolve
122122 <|> do discard (P.symbol "nobanner") ; return NoBanner
123+ <|> do discard (P.symbol "warnreach"); return WarnReach
123124
124125codegenOption :: P.IdrisParser Codegen
125126codegenOption = do discard (P.symbol "javascript"); return ViaJavaScript