chore: Version 0.3 #136
|
@ -149,9 +149,14 @@ def sorrysToGoalState (sorrys : List InfoWithContext) : MetaM AnnotatedGoalState
|
||||||
match i.info with
|
match i.info with
|
||||||
| .ofTermInfo termInfo => do
|
| .ofTermInfo termInfo => do
|
||||||
let mvarId ← MetaTranslate.translateMVarFromTermInfo termInfo i.context?
|
let mvarId ← MetaTranslate.translateMVarFromTermInfo termInfo i.context?
|
||||||
|
if (← mvarId.getType).hasSorry then
|
||||||
|
throwError s!"Coupling is not allowed in drafting"
|
||||||
return [(mvarId, stxByteRange termInfo.stx)]
|
return [(mvarId, stxByteRange termInfo.stx)]
|
||||||
| .ofTacticInfo tacticInfo => do
|
| .ofTacticInfo tacticInfo => do
|
||||||
let mvarIds ← MetaTranslate.translateMVarFromTacticInfoBefore tacticInfo i.context?
|
let mvarIds ← MetaTranslate.translateMVarFromTacticInfoBefore tacticInfo i.context?
|
||||||
|
for mvarId in mvarIds do
|
||||||
|
if (← mvarId.getType).hasSorry then
|
||||||
|
throwError s!"Coupling is not allowed in drafting"
|
||||||
let range := stxByteRange tacticInfo.stx
|
let range := stxByteRange tacticInfo.stx
|
||||||
return mvarIds.map (·, range)
|
return mvarIds.map (·, range)
|
||||||
| _ => panic! "Invalid info"
|
| _ => panic! "Invalid info"
|
||||||
|
|
|
@ -30,7 +30,9 @@ def evalAssign : Elab.Tactic.Tactic := fun stx => Elab.Tactic.withMainContext do
|
||||||
def sorryToHole (src : Expr) : StateRefT (List MVarId) MetaM Expr := do
|
def sorryToHole (src : Expr) : StateRefT (List MVarId) MetaM Expr := do
|
||||||
Meta.transform src λ
|
Meta.transform src λ
|
||||||
| .app (.app (.const ``sorryAx ..) type) .. => do
|
| .app (.app (.const ``sorryAx ..) type) .. => do
|
||||||
-- FIXME: Handle cases of coupled goals
|
let type ← instantiateMVars type
|
||||||
|
if type.hasSorry then
|
||||||
|
throwError s!"Coupling is not allowed in draft tactic: {← Meta.ppExpr type}"
|
||||||
let mvar ← Meta.mkFreshExprSyntheticOpaqueMVar type
|
let mvar ← Meta.mkFreshExprSyntheticOpaqueMVar type
|
||||||
modify (mvar.mvarId! :: .)
|
modify (mvar.mvarId! :: .)
|
||||||
pure $ .done mvar
|
pure $ .done mvar
|
||||||
|
|
Loading…
Reference in New Issue