merge again

This commit is contained in:
Jon Eugster
2022-12-12 21:01:13 +01:00
6 changed files with 85 additions and 112 deletions
+2 -2
View File
@@ -82,8 +82,8 @@ elab "Statement" statementName:ident ? descr:str sig:declSig val:declVal : comma
elabCommand thmStatement
modifyCurLevel fun level => pure {level with
goal := sig,
description := descr.getString,
ppStatement := match statementName with
descrText := descr.getString,
descrFormat := match statementName with
| none => "example " ++ (toString <| reprint sig.raw) ++ " := by"
| some name => (Format.join ["lemma ", reprint name.raw, " ", reprint sig.raw, " := by"]).pretty 10 -- "lemma " ++ (toString <| reprint name.raw) ++ " " ++ (Format.pretty (reprint sig.raw) 40) ++ " := by"
} -- Format.pretty <| format thmStatement.raw }
@@ -202,7 +202,8 @@ structure GameLevel where
lemmas: Array LemmaDocEntry := default
messages: Array GoalMessageEntry := default
goal : TSyntax `Lean.Parser.Command.declSig := default
ppStatement : String := default
descrText: String := default
descrFormat : String := default
deriving Inhabited, Repr
/-! ## World -/
+4 -4
View File
@@ -41,8 +41,8 @@ structure LevelInfo where
tactics: Array TacticDocEntry
lemmas: Array LemmaDocEntry
introduction : String
description : String
ppStatement : String
descrText : String := ""
descrFormat : String := ""
deriving ToJson
structure LoadLevelParams where
@@ -70,8 +70,8 @@ partial def handleServerEvent (ev : ServerEvent) : GameServerM Bool := do
title := lvl.title,
tactics := lvl.tactics,
lemmas := lvl.lemmas,
description := lvl.description,
ppStatement := lvl.ppStatement --toExpr <| format (lvl.goal.raw) --toString <| Syntax.formatStx (lvl.goal.raw) --Syntax.formatStx (lvl.goal.raw) , -- TODO
descrText := lvl.descrText,
descrFormat := lvl.descrFormat --toExpr <| format (lvl.goal.raw) --toString <| Syntax.formatStx (lvl.goal.raw) --Syntax.formatStx (lvl.goal.raw) , -- TODO
introduction := lvl.introduction }
c.hOut.writeLspResponse ⟨id, ToJson.toJson levelInfo⟩
return true