Compare commits
No commits in common. "976646fb67f3c86365b06ac1e5332047444ea3aa" and "b67d3eccc474e6601dcc1cd727fa1b3d9f06a1f8" have entirely different histories.
976646fb67
...
b67d3eccc4
|
@ -23,10 +23,10 @@ def parseCommand (s: String): Except String Command := do
|
||||||
return { cmd := s.take offset, payload := payload }
|
return { cmd := s.take offset, payload := payload }
|
||||||
| .none => throw "Command is empty"
|
| .none => throw "Command is empty"
|
||||||
|
|
||||||
partial def loop : MainM Unit := do repeat do
|
partial def loop : MainM Unit := do
|
||||||
let state ← get
|
let state ← get
|
||||||
let command ← (← IO.getStdin).getLine
|
let command ← (← IO.getStdin).getLine
|
||||||
if command.trim.length = 0 then break
|
if command.trim.length = 0 then return ()
|
||||||
match parseCommand command with
|
match parseCommand command with
|
||||||
| .error error =>
|
| .error error =>
|
||||||
let error := Lean.toJson ({ error := "command", desc := error }: InteractionError)
|
let error := Lean.toJson ({ error := "command", desc := error }: InteractionError)
|
||||||
|
@ -43,6 +43,7 @@ partial def loop : MainM Unit := do repeat do
|
||||||
let message ← e.toMessageData.toString
|
let message ← e.toMessageData.toString
|
||||||
let error := Lean.toJson ({ error := "main", desc := message }: InteractionError)
|
let error := Lean.toJson ({ error := "main", desc := message }: InteractionError)
|
||||||
IO.println error.compress
|
IO.println error.compress
|
||||||
|
loop
|
||||||
|
|
||||||
|
|
||||||
unsafe def main (args: List String): IO Unit := do
|
unsafe def main (args: List String): IO Unit := do
|
||||||
|
|
|
@ -110,7 +110,7 @@ def test_symbol_location : TestT IO Unit := do
|
||||||
checkTrue "file" result.sourceUri?.isNone
|
checkTrue "file" result.sourceUri?.isNone
|
||||||
checkEq "pos" (result.sourceStart?.map (·.column)) <| .some 0
|
checkEq "pos" (result.sourceStart?.map (·.column)) <| .some 0
|
||||||
checkEq "pos" (result.sourceEnd?.map (·.column)) <| .some 88
|
checkEq "pos" (result.sourceEnd?.map (·.column)) <| .some 88
|
||||||
let .ok { imports, constNames, .. } ← Environment.moduleRead ⟨"Init.Data.Nat.Basic"⟩ | fail "Module read failed"
|
let .ok { imports, constNames, extraConstNames } ← Environment.moduleRead ⟨"Init.Data.Nat.Basic"⟩ | fail "Module read failed"
|
||||||
checkEq "imports" imports #["Init.SimpLemmas", "Init.Data.NeZero"]
|
checkEq "imports" imports #["Init.SimpLemmas", "Init.Data.NeZero"]
|
||||||
checkTrue "constNames" $ constNames.contains "Nat.succ_add"
|
checkTrue "constNames" $ constNames.contains "Nat.succ_add"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue