exclude 'only' keyword from forbidden tactics

pull/43/head
Jon Eugster 3 years ago
parent c015d1e1f9
commit c679325c46

@ -75,7 +75,7 @@ partial def findForbiddenTactics (inputCtx : Parser.InputContext) (levelParams :
| .atom info val => | .atom info val =>
-- ignore syntax elements that do not start with a letter -- ignore syntax elements that do not start with a letter
-- and ignore "with" keyword -- and ignore "with" keyword
if 0 < val.length ∧ val.data[0]!.isAlpha ∧ val != "with" ∧ val != "at" then if 0 < val.length ∧ val.data[0]!.isAlpha ∧ val != "with" ∧ val != "at" ^ val != "only" then
let val := val.dropRightWhile (fun c => c == '!' || c == '?') -- treat `simp?` and `simp!` like `simp` let val := val.dropRightWhile (fun c => c == '!' || c == '?') -- treat `simp?` and `simp!` like `simp`
match levelParams.tactics.find? (fun t => t.name.toString == val) with match levelParams.tactics.find? (fun t => t.name.toString == val) with
| none => addErrorMessage info s!"You have not unlocked the tactic '{val}' yet!" | none => addErrorMessage info s!"You have not unlocked the tactic '{val}' yet!"

Loading…
Cancel
Save