Skip to content

Commit

Permalink
whitelist generalizing and says. #173
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed Jan 19, 2024
1 parent fd5e507 commit ca57654
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/GameServer/FileWorker.lean
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ partial def findForbiddenTactics (inputCtx : Parser.InputContext)
for arg in args do
findForbiddenTactics inputCtx gameWorkerState arg
| .atom info val =>
-- ignore syntax elements that do not start with a letter
-- and ignore "with" keyword
let allowed := ["with", "fun", "at", "only", "by", "to"]
-- Whitelisted keywords.
-- Note: We need a whitelist because we cannot really distinguish keywords from tactics.
let allowed := ["with", "fun", "at", "only", "by", "to", "generalizing", "says"]
-- ignore syntax elements that do not start with a letter or are allowed
if 0 < val.length ∧ val.data[0]!.isAlpha ∧ not (allowed.contains val) then
let val := val.dropRightWhile (fun c => c == '!' || c == '?') -- treat `simp?` and `simp!` like `simp`
match levelInfo.tactics.find? (·.name.toString == val) with
Expand Down

0 comments on commit ca57654

Please sign in to comment.