feat: Automatic Mode #92
11
Repl.lean
11
Repl.lean
|
@ -169,9 +169,7 @@ def execute (command: Protocol.Command): MainM Lean.Json := do
|
||||||
return .ok { tacticErrors? := .some messages }
|
return .ok { tacticErrors? := .some messages }
|
||||||
goal_continue (args: Protocol.GoalContinue): MainM (CR Protocol.GoalContinueResult) := do
|
goal_continue (args: Protocol.GoalContinue): MainM (CR Protocol.GoalContinueResult) := do
|
||||||
let state ← get
|
let state ← get
|
||||||
match state.goalStates.find? args.target with
|
let .some target := state.goalStates.find? args.target | return .error $ errorIndex s!"Invalid state index {args.target}"
|
||||||
| .none => return .error $ errorIndex s!"Invalid state index {args.target}"
|
|
||||||
| .some target => do
|
|
||||||
let nextState? ← match args.branch?, args.goals? with
|
let nextState? ← match args.branch?, args.goals? with
|
||||||
| .some branchId, .none => do
|
| .some branchId, .none => do
|
||||||
match state.goalStates.find? branchId with
|
match state.goalStates.find? branchId with
|
||||||
|
@ -200,10 +198,9 @@ def execute (command: Protocol.Command): MainM Lean.Json := do
|
||||||
return .ok {}
|
return .ok {}
|
||||||
goal_print (args: Protocol.GoalPrint): MainM (CR Protocol.GoalPrintResult) := do
|
goal_print (args: Protocol.GoalPrint): MainM (CR Protocol.GoalPrintResult) := do
|
||||||
let state ← get
|
let state ← get
|
||||||
match state.goalStates.find? args.stateId with
|
let .some goalState := state.goalStates.find? args.stateId | return .error $ errorIndex s!"Invalid state index {args.stateId}"
|
||||||
| .none => return .error $ errorIndex s!"Invalid state index {args.stateId}"
|
let result ← runMetaInMainM <| goalPrint goalState state.options
|
||||||
| .some goalState => runMetaM <| do
|
return .ok result
|
||||||
return .ok (← goalPrint goalState state.options)
|
|
||||||
compile_unit (args: Protocol.CompileUnit): MainM (CR Protocol.CompileUnitResult) := do
|
compile_unit (args: Protocol.CompileUnit): MainM (CR Protocol.CompileUnitResult) := do
|
||||||
let module := args.module.toName
|
let module := args.module.toName
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue