Skip to content

Commit

Permalink
No longer need to drop messages and trees in proccessCommandsWithInfo…
Browse files Browse the repository at this point in the history
…Trees

Signed-off-by: Andrew Wells <andrewmw94@gmail.com>
  • Loading branch information
andrewmw94 committed Oct 17, 2024
1 parent 603affe commit 32d7d8a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 1 addition & 4 deletions REPL/Frontend.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ def processCommandsWithInfoTrees
(commandState : Command.State) : IO (Command.State × List Message × List InfoTree) := do
let commandState := { commandState with infoState.enabled := true }
let s ← IO.processCommands inputCtx parserState commandState <&> Frontend.State.commandState
let msgs := s.messages.toList.drop commandState.messages.toList.length
let trees := s.infoState.trees.toList.drop commandState.infoState.trees.size

pure (s, msgs, trees)
pure (s, s.messages.toList, s.infoState.trees.toList)

/--
Process some text input, with or without an existing command state.
Expand Down
2 changes: 0 additions & 2 deletions REPL/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ def runCommand (s : Command) : M IO (CommandResponse ⊕ Error) := do
let tactics ← match s.allTactics with
| some true => tactics trees
| _ => pure []
-- The list is repeated, so we only keep the second half.
let tactics := tactics.drop (tactics.length / 2)
let cmdSnapshot :=
{ cmdState
cmdContext := (cmdSnapshot?.map fun c => c.cmdContext).getD
Expand Down

0 comments on commit 32d7d8a

Please sign in to comment.