@@ -331,6 +331,14 @@ caseOption syn = do lhs <- expr (syn { inPattern = True })
331 return (lhs, r)
331 return (lhs, r)
332 <?> "case option"
332 <?> "case option"
334+warnTacticDeprecation :: FC -> IdrisParser ()
335+warnTacticDeprecation fc =
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 }
334{- | Parses a proof block
342{- | Parses a proof block
336ProofExpr ::=
344ProofExpr ::=
@@ -342,9 +350,7 @@ proofExpr :: SyntaxInfo -> IdrisParser PTerm
342proofExpr syn = do kw <- reservedFC "proof"
350proofExpr syn = do kw <- reservedFC "proof"
343 ts <- indentedBlock1 (tactic syn)
351 ts <- indentedBlock1 (tactic syn)
344 highlightP kw AnnKeyword
352 highlightP kw AnnKeyword
345− ist <- get
353+ warnTacticDeprecation kw
346− put ist { parserWarnings =
347− (kw, Msg "This style of tactic proof is deprecated. See %runElab for the replacement.") : parserWarnings ist }
348 return $ PProof ts
354 return $ PProof ts
349 <?> "proof block"
355 <?> "proof block"
@@ -359,9 +365,7 @@ tacticsExpr :: SyntaxInfo -> IdrisParser PTerm
359tacticsExpr syn = do kw <- reservedFC "tactics"
365tacticsExpr syn = do kw <- reservedFC "tactics"
360 ts <- indentedBlock1 (tactic syn)
366 ts <- indentedBlock1 (tactic syn)
361 highlightP kw AnnKeyword
367 highlightP kw AnnKeyword
362− ist <- get
368+ warnTacticDeprecation kw
363− put ist { parserWarnings =
364− (kw, Msg "This style of tactic proof is deprecated. See %runElab for the replacement.") : parserWarnings ist }
365 return $ PTactics ts
369 return $ PTactics ts
366 <?> "tactics block"
370 <?> "tactics block"