feat: Use CoreM for diag monad

This commit is contained in:
Leni Aniva 2024-08-26 13:42:14 -04:00
parent 0c529c5cd9
commit edec0f5733
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
1 changed files with 25 additions and 23 deletions

View File

@ -289,7 +289,8 @@ protected def GoalState.serializeGoals
/-- Print the metavariables in a readable format -/
@[export pantograph_goal_state_diag_m]
protected def GoalState.diag (goalState: GoalState) (parent?: Option GoalState := .none) (options: Protocol.GoalDiag := {}): MetaM String := do
protected def GoalState.diag (goalState: GoalState) (parent?: Option GoalState := .none) (options: Protocol.GoalDiag := {}): CoreM String := do
let metaM: MetaM String := do
goalState.restoreMetaM
let savedState := goalState.savedState
let goals := savedState.tactic.goals
@ -312,6 +313,7 @@ protected def GoalState.diag (goalState: GoalState) (parent?: Option GoalState :
printMVar pref mvarId decl
)
pure $ result ++ "\n" ++ (resultGoals.map (· ++ "\n") |> String.join) ++ (resultOthers.map (· ++ "\n") |> String.join)
metaM.run' {}
where
printMVar (pref: String) (mvarId: MVarId) (decl: MetavarDecl): MetaM String := mvarId.withContext do
let resultFVars: List String ←