fix(repl): Allow .none in parentExpr
This commit is contained in:
parent
dd7c6c36c8
commit
3fab7e7818
|
@ -132,8 +132,9 @@ def goalPrint (state: GoalState) (rootExpr: Bool) (parentExprs: Bool) (goals: Bo
|
|||
pure .none
|
||||
let parentExprs? ← if parentExprs then
|
||||
.some <$> state.parentMVars.mapM λ parent => parent.withContext do
|
||||
let val := state.getMVarEAssignment parent |>.get!
|
||||
serializeExpression options (← instantiateAll val)
|
||||
let val? := state.getMVarEAssignment parent
|
||||
val?.mapM λ val => do
|
||||
serializeExpression options (← instantiateAll val)
|
||||
else
|
||||
pure .none
|
||||
let goals ← if goals then
|
||||
|
|
|
@ -325,7 +325,7 @@ structure GoalPrintResult where
|
|||
-- The root expression
|
||||
root?: Option Expression := .none
|
||||
-- The filling expression of the parent goal
|
||||
parentExprs?: Option (List Expression) := .none
|
||||
parentExprs?: Option (List (Option Expression)) := .none
|
||||
goals: Array Goal := #[]
|
||||
extraMVars: Array Expression := #[]
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ def test_tactic : Test := do
|
|||
step "goal.print" ({ stateId := 1, parentExprs? := .some true, rootExpr? := .some true }: Protocol.GoalPrint)
|
||||
({
|
||||
root? := .some { pp? := "fun x => ?m.11"},
|
||||
parentExprs? := .some [{ pp? := .some "fun x => ?m.11" }],
|
||||
parentExprs? := .some [.some { pp? := .some "fun x => ?m.11" }],
|
||||
}: Protocol.GoalPrintResult)
|
||||
step "goal.tactic" ({ stateId := 1, tactic? := .some "intro y" }: Protocol.GoalTactic)
|
||||
({ nextStateId? := .some 2, goals? := #[goal2], }: Protocol.GoalTacticResult)
|
||||
|
|
Loading…
Reference in New Issue