@@ -331,6 +331,14 @@ caseOption syn = do lhs <- expr (syn { inPattern = True })
331331 return (lhs, r)
332332 <?> "case option"
333333
334+warnTacticDeprecation :: FC -> IdrisParser ()
335+warnTacticDeprecation fc =
336+ do ist <- get
337+ let cmdline = opt_cmdline (idris_options ist)
338+ unless (NoOldTacticDeprecationWarnings `elem` cmdline) $
339+ put ist { parserWarnings =
340+ (fc, Msg "This style of tactic proof is deprecated. See %runElab for the replacement.") : parserWarnings ist }
341+
334342{- | Parses a proof block
335343@
336344ProofExpr ::=
@@ -342,9 +350,7 @@ proofExpr :: SyntaxInfo -> IdrisParser PTerm
342350proofExpr syn = do kw <- reservedFC "proof"
343351 ts <- indentedBlock1 (tactic syn)
344352 highlightP kw AnnKeyword
345− ist <- get
346− put ist { parserWarnings =
347− (kw, Msg "This style of tactic proof is deprecated. See %runElab for the replacement.") : parserWarnings ist }
353+ warnTacticDeprecation kw
348354 return $ PProof ts
349355 <?> "proof block"
350356
@@ -359,9 +365,7 @@ tacticsExpr :: SyntaxInfo -> IdrisParser PTerm
359365tacticsExpr syn = do kw <- reservedFC "tactics"
360366 ts <- indentedBlock1 (tactic syn)
361367 highlightP kw AnnKeyword
362− ist <- get
363− put ist { parserWarnings =
364− (kw, Msg "This style of tactic proof is deprecated. See %runElab for the replacement.") : parserWarnings ist }
368+ warnTacticDeprecation kw
365369 return $ PTactics ts
366370 <?> "tactics block"
367371