partial bump to v4.8.0: simple fixes
This commit is contained in:
@@ -190,7 +190,7 @@ def getCurLayer [MonadError m] : m Layer := do
|
||||
def getCurGameId [Monad m] : m Name := do
|
||||
match curGameExt.getState (← getEnv) with
|
||||
| some game => return game
|
||||
| none => return defaultGameName
|
||||
| none => return (.mkSimple defaultGameName)
|
||||
|
||||
/-- Get the current world -/
|
||||
def getCurWorldId [MonadError m] : m Name := do
|
||||
@@ -468,8 +468,8 @@ def getLevel? (levelId : LevelId) : m (Option GameLevel) := do
|
||||
|
||||
def getCurGame [Monad m] : m Game := do
|
||||
let some game ← getGame? (← getCurGameId)
|
||||
| let game := {name := defaultGameName}
|
||||
insertGame defaultGameName game
|
||||
| let game := {name := (.mkSimple defaultGameName)}
|
||||
insertGame (.mkSimple defaultGameName) game
|
||||
return game
|
||||
return game
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import Lean.PrettyPrinter.Delaborator.Builtins
|
||||
import Lean.PrettyPrinter
|
||||
import Lean
|
||||
|
||||
import Std.Tactic.OpenPrivate
|
||||
import Batteries.Tactic.OpenPrivate
|
||||
|
||||
namespace GameServer
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Lean.Environment
|
||||
import Std.Tactic.OpenPrivate
|
||||
import Batteries.Tactic.OpenPrivate
|
||||
import Lean.Data.Lsp.Communication
|
||||
|
||||
open Lean
|
||||
|
||||
@@ -124,7 +124,7 @@ partial def collectUsedInventory (stx : Syntax) (acc : UsedInventory := {}) : Co
|
||||
let allowed := GameServer.ALLOWED_KEYWORDS
|
||||
if 0 < val.length ∧ val.data[0]!.isAlpha ∧ not (allowed.contains val) then
|
||||
let val := val.dropRightWhile (fun c => c == '!' || c == '?') -- treat `simp?` and `simp!` like `simp`
|
||||
return {acc with tactics := acc.tactics.insert val}
|
||||
return {acc with tactics := acc.tactics.insert (.mkSimple val)}
|
||||
else
|
||||
return acc
|
||||
| .ident _info _rawVal val _preresolved =>
|
||||
|
||||
@@ -17,7 +17,7 @@ def levelIdFromFileName? (initParams : Lsp.InitializeParams) (fileName : String)
|
||||
let fileParts := fileName.splitOn "/"
|
||||
if fileParts.length == 3 then
|
||||
if let (some level, some game) := (fileParts[2]!.toNat?, initParams.rootUri?) then
|
||||
return some {game, world := fileParts[1]!, level := level}
|
||||
return some {game := .mkSimple game, world := .mkSimple fileParts[1]!, level := level}
|
||||
return none
|
||||
|
||||
def getLevelByFileName? [Monad m] [MonadEnv m] (initParams : Lsp.InitializeParams) (fileName : String) : m (Option GameLevel) := do
|
||||
@@ -123,7 +123,7 @@ def findHints (goal : MVarId) (m : DocumentMeta) (initParams : Lsp.InitializePar
|
||||
let mut hintFVarsNames : Array Expr := #[]
|
||||
for fvar in hintFVars do
|
||||
let name₁ ← fvar.fvarId!.getUserName
|
||||
hintFVarsNames := hintFVarsNames.push <| Expr.fvar ⟨s!"«\{{name₁}}»"⟩
|
||||
hintFVarsNames := hintFVarsNames.push <| Expr.fvar ⟨.mkSimple s!"«\{{name₁}}»"⟩
|
||||
|
||||
let lctx := (← goal.getDecl).lctx -- the player's local context
|
||||
if let some bij ← matchDecls hintFVars lctx.getFVars
|
||||
|
||||
@@ -35,7 +35,7 @@ elab "#show_option" verbose:(ppSpace showOptArg)? id:(ppSpace Parser.rawIdent)?
|
||||
| .ofNat val => s!"Nat := {repr val}"
|
||||
| .ofInt val => s!"Int := {repr val}"
|
||||
| .ofSyntax val => s!"Syntax := {repr val}"
|
||||
if let some val := opts.find name then
|
||||
if let some val := opts.find (.mkSimple name) then
|
||||
msg1 := s!"{msg1} (currently: {val})"
|
||||
msg := match verbose with
|
||||
| some opt =>
|
||||
|
||||
Reference in New Issue
Block a user