better
This commit is contained in:
@@ -298,7 +298,6 @@ elab attrs:Lean.Parser.Term.attributes ? "Statement" statementName:ident ? descr
|
||||
let defaultDeclName : Ident := mkIdent <| (← getCurGame).name ++ (← getCurWorld).name ++
|
||||
("level" ++ toString lvlIdx : String)
|
||||
|
||||
let doc? : Option (TSyntax ``Parser.Command.docComment) := none
|
||||
-- Add theorem to context.
|
||||
match statementName with
|
||||
| some name =>
|
||||
@@ -312,19 +311,19 @@ elab attrs:Lean.Parser.Term.attributes ? "Statement" statementName:ident ? descr
|
||||
-- in that case.
|
||||
logWarningAt name (m!"Environment already contains {fullName}! Only the existing " ++
|
||||
m!"statement will be available in later levels:\n\n{origType}")
|
||||
let thmStatement ← `(command| $[$doc?]? $[$attrs]? theorem $defaultDeclName $sig $val)
|
||||
let thmStatement ← `(command| $[$attrs:attributes]? theorem $defaultDeclName $sig $val)
|
||||
elabCommand thmStatement
|
||||
-- Check that statement has a docs entry.
|
||||
checkInventoryDoc .Lemma name (template := descr)
|
||||
|
||||
else
|
||||
let thmStatement ← `(command| $[$doc?]? $[$attrs]? theorem $name $sig $val)
|
||||
let thmStatement ← `(command| $[$attrs:attributes]? theorem $name $sig $val)
|
||||
elabCommand thmStatement
|
||||
-- Check that statement has a docs entry.
|
||||
checkInventoryDoc .Lemma name (template := descr)
|
||||
|
||||
| none =>
|
||||
let thmStatement ← `(command| $[$doc?]? $[$attrs]? theorem $defaultDeclName $sig $val)
|
||||
let thmStatement ← `(command| $[$attrs:attributes]? theorem $defaultDeclName $sig $val)
|
||||
elabCommand thmStatement
|
||||
|
||||
let msgs := (← get).messages
|
||||
|
||||
Reference in New Issue
Block a user