|
|
|
@ -213,7 +213,7 @@ def compileProof (inputCtx : Parser.InputContext) (snap : Snapshot) (hasWidgets
|
|
|
|
modify (fun s => { s with messages := msgLog })
|
|
|
|
modify (fun s => { s with messages := msgLog })
|
|
|
|
parseResultRef.set (tacticStx, cmdParserState)
|
|
|
|
parseResultRef.set (tacticStx, cmdParserState)
|
|
|
|
|
|
|
|
|
|
|
|
-- TODO: Check for forbidden tactics
|
|
|
|
-- Check for forbidden tactics
|
|
|
|
findForbiddenTactics inputCtx gameWorkerState level tacticStx
|
|
|
|
findForbiddenTactics inputCtx gameWorkerState level tacticStx
|
|
|
|
|
|
|
|
|
|
|
|
-- Insert invisible `skip` command to make sure we always display the initial goal
|
|
|
|
-- Insert invisible `skip` command to make sure we always display the initial goal
|
|
|
|
@ -590,7 +590,7 @@ end MainLoop
|
|
|
|
def initAndRunWorker (i o e : FS.Stream) (opts : Options) (gameDir : String) : IO UInt32 := do
|
|
|
|
def initAndRunWorker (i o e : FS.Stream) (opts : Options) (gameDir : String) : IO UInt32 := do
|
|
|
|
let i ← maybeTee "fwIn.txt" false i
|
|
|
|
let i ← maybeTee "fwIn.txt" false i
|
|
|
|
let o ← maybeTee "fwOut.txt" true o
|
|
|
|
let o ← maybeTee "fwOut.txt" true o
|
|
|
|
let initRequest ← i.readLspRequestAs "initialize" InitializeParams
|
|
|
|
let initRequest ← i.readLspRequestAs "initialize" Game.InitializeParams
|
|
|
|
o.writeLspResponse {
|
|
|
|
o.writeLspResponse {
|
|
|
|
id := initRequest.id
|
|
|
|
id := initRequest.id
|
|
|
|
result := {
|
|
|
|
result := {
|
|
|
|
@ -616,20 +616,15 @@ def initAndRunWorker (i o e : FS.Stream) (opts : Options) (gameDir : String) : I
|
|
|
|
let _ ← IO.setStderr e
|
|
|
|
let _ ← IO.setStderr e
|
|
|
|
try
|
|
|
|
try
|
|
|
|
let game ← loadGameData gameDir
|
|
|
|
let game ← loadGameData gameDir
|
|
|
|
let s : GameWorkerState:= {
|
|
|
|
let some initializationOptions := initRequest.param.initializationOptions?
|
|
|
|
-- uri := doc.uri
|
|
|
|
| throwServerError "no initialization options found"
|
|
|
|
-- gameDir := gameDir
|
|
|
|
let gameWorkerState : GameWorkerState:= {
|
|
|
|
-- levelModule := sorry
|
|
|
|
inventory := initializationOptions.inventory
|
|
|
|
-- tactics := sorry
|
|
|
|
difficulty := initializationOptions.difficulty
|
|
|
|
-- lemmas := sorry
|
|
|
|
|
|
|
|
-- definitions := sorry
|
|
|
|
|
|
|
|
inventory := #[] -- TODO: Ensure that this is set in time!
|
|
|
|
|
|
|
|
difficulty := 0 -- TODO: Ensure that this is set in time!
|
|
|
|
|
|
|
|
-- statementName := sorry
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let (ctx, st) ← initializeWorker meta i o e initRequest.param opts gameDir game s
|
|
|
|
let (ctx, st) ← initializeWorker meta i o e initRequest.param.toLeanInternal opts gameDir game gameWorkerState
|
|
|
|
let _ ← StateRefT'.run (s := st) <| ReaderT.run (r := ctx) <|
|
|
|
|
let _ ← StateRefT'.run (s := st) <| ReaderT.run (r := ctx) <|
|
|
|
|
StateT.run (s := s) <| (mainLoop)
|
|
|
|
StateT.run (s := gameWorkerState) <| (mainLoop)
|
|
|
|
return (0 : UInt32)
|
|
|
|
return (0 : UInt32)
|
|
|
|
catch e =>
|
|
|
|
catch e =>
|
|
|
|
IO.eprintln e
|
|
|
|
IO.eprintln e
|
|
|
|
|