Skip to content

Commit 60ca564

Browse files
chore: bump toolchain to v4.31.0 (#865)
Co-authored-by: David Thrane Christiansen <david@davidchristiansen.dk>
1 parent 10fbd87 commit 60ca564

7 files changed

Lines changed: 32 additions & 42 deletions

File tree

Manual/Meta/Example.lean

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def Block.example (descriptionString : String) (name : Option String) (opened :
2828
abbrev ExampleBlockJson := String × Option String × Bool × Option Tag × Option String
2929

3030
structure ExampleConfig where
31-
description : FileMap × TSyntaxArray `inline
31+
description : TSyntaxArray `inline
3232
/-- Name for refs -/
3333
tag : Option String := none
3434
keep : Bool := false
@@ -110,12 +110,10 @@ def examples : Domain := {}
110110
@[directive]
111111
def «example» : DirectiveExpanderOf ExampleConfig
112112
| cfg, contents => do
113-
let description ←
114-
DocElabM.withFileMap cfg.description.1 <|
115-
cfg.description.2.mapM elabInline
116-
let descriptionString := inlinesToString (← getEnv) cfg.description.2
117-
PointOfInterest.save (← getRef) (inlinesToString (← getEnv) cfg.description.2)
118-
(selectionRange := mkNullNode cfg.description.2)
113+
let description ← cfg.description.mapM elabInline
114+
let descriptionString := inlinesToString (← getEnv) cfg.description
115+
PointOfInterest.save (← getRef) (inlinesToString (← getEnv) cfg.description)
116+
(selectionSyntax? := some <| mkNullNode cfg.description)
119117
(kind := Lsp.SymbolKind.interface)
120118
(detail? := some "Example")
121119

Manual/Meta/Figure.lean

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def Block.figure (captionString : String) (name : Option String) : Block where
2424
data := ToJson.toJson (captionString, name, (none : Option Tag))
2525

2626
structure FigureConfig where
27-
caption : FileMap × TSyntaxArray `inline
27+
caption : TSyntaxArray `inline
2828
/-- Name for refs -/
2929
tag : Option String := none
3030

@@ -37,15 +37,14 @@ def figure : DirectiveExpander
3737
| args, contents => do
3838
let cfg ← FigureConfig.parse.run args
3939

40-
PointOfInterest.save (← getRef) (inlinesToString (← getEnv) cfg.caption.2)
41-
(selectionRange := mkNullNode cfg.caption.2)
40+
PointOfInterest.save (← getRef) (inlinesToString (← getEnv) cfg.caption)
41+
(selectionSyntax? := some <| mkNullNode cfg.caption)
4242
(kind := Lsp.SymbolKind.interface)
4343
(detail? := some "Figure")
4444

45-
let caption ← DocElabM.withFileMap cfg.caption.1 <|
46-
cfg.caption.2.mapM elabInline
45+
let caption ← cfg.caption.mapM elabInline
4746

48-
let captionString := inlinesToString (← getEnv) cfg.caption.2
47+
let captionString := inlinesToString (← getEnv) cfg.caption
4948

5049
let blocks ← contents.mapM elabBlock
5150
-- Figures are represented using the first block to hold the caption. Storing it in the JSON

Manual/Meta/Markdown.lean

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ def Block.noVale.descr : BlockDescr where
3030

3131
/-- Closes the last-opened section, throwing an error on failure. -/
3232
def closeEnclosingSection : PartElabM Unit := do
33-
-- We use `default` as the source position because the Markdown doesn't have one
34-
if let some ctxt' := (← getThe PartElabM.State).partContext.close default then
33+
-- Markdown headers carry no source extent of their own, so end the section at the end of the
34+
-- current reference. This keeps each part's range valid (the selection stays within
35+
-- `[rangeStart, endPos]`) for the TOC range conversion.
36+
let endPos := (← getRef).getTailPos?.getD default
37+
if let some ctxt' := (← getThe PartElabM.State).partContext.close endPos then
3538
modifyThe PartElabM.State fun st => {st with partContext := ctxt'}
3639
else
3740
throwError m!"Failed to close the last-opened explanation part"
@@ -51,7 +54,7 @@ def markdown : PartCommand
5154
logErrorAt arg m!"No arguments expected{h}"
5255
let some ast := MD4Lean.parse txt.getString
5356
| throwError "Failed to parse body of markdown code block"
54-
let mut currentHeaderLevels : Markdown.HeaderMapping := default
57+
let mut currentHeaderLevels : Markdown.HeaderMapping := {}
5558
for block in ast.blocks do
5659
currentHeaderLevels ← Markdown.addPartFromMarkdown block currentHeaderLevels
5760
closeEnclosingSections currentHeaderLevels

Manual/Meta/Syntax.lean

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ structure FreeSyntaxConfig where
8181
name : Name
8282
«open» : Bool := true
8383
label : Option String := none
84-
title : (FileMap × TSyntaxArray `inline)
84+
title : TSyntaxArray `inline
8585

8686
def FreeSyntaxConfig.getLabel (config : FreeSyntaxConfig) : String :=
8787
config.label.getD <|
@@ -830,7 +830,7 @@ where
830830
return bar ++ .nest 2 (← production which stx |>.run' {})
831831

832832
def testGetBnf (config : FreeSyntaxConfig) (isFirst : Bool) (stxs : List Syntax) : TermElabM String := do
833-
let (tagged, _) ← getBnf config isFirst stxs |>.run ⟨default, default, default, default⟩ {} {partContext := ⟨⟨default, default, default, default, default⟩, default⟩}
833+
let (tagged, _) ← getBnf config isFirst stxs |>.run ⟨default, default, default, default⟩ {} {partContext := ⟨⟨default, default, default, default, default, default⟩, default⟩}
834834
pure tagged.stripTags
835835

836836
namespace Tests
@@ -841,7 +841,7 @@ def selectedParser : Parser := leading_parser
841841

842842

843843
elab "#test_syntax" arg:selectedParser : command => do
844-
let bnf ← Command.liftTermElabM (testGetBnf {name := (TSyntax.mk arg.raw[0]).getId, title := (FileMap.ofString "", #[])} true [arg.raw[2]])
844+
let bnf ← Command.liftTermElabM (testGetBnf { name := (TSyntax.mk arg.raw[0]).getId, title := #[] } true [arg.raw[2]])
845845
logInfo bnf
846846

847847
/--
@@ -867,7 +867,7 @@ info: term ::= ...
867867

868868

869869
elab "#test_free_syntax" x:ident arg:free_syntaxes : command => do
870-
let bnf ← Command.liftTermElabM (testGetBnf {name := x.getId, title := (FileMap.ofString "", #[])} true (FreeSyntax.decodeMany arg |>.map FreeSyntax.decode))
870+
let bnf ← Command.liftTermElabM (testGetBnf { name := x.getId, title := #[] } true (FreeSyntax.decodeMany arg |>.map FreeSyntax.decode))
871871
logInfo bnf
872872

873873
/--
@@ -1084,12 +1084,10 @@ def «syntax» : DirectiveExpander
10841084
| args, blocks => do
10851085
let config ← SyntaxConfig.parse.run args
10861086

1087-
let title ← do
1088-
let (fm, t) := config.title
1089-
DocElabM.withFileMap fm <| t.mapM elabInline
1087+
let title ← config.title.mapM elabInline
10901088

10911089
let env ← getEnv
1092-
let titleString := inlinesToString env (config.title.snd)
1090+
let titleString := inlinesToString env (config.title)
10931091

10941092
let mut content := #[]
10951093
let mut firstGrammar := true
@@ -1102,8 +1100,7 @@ def «syntax» : DirectiveExpander
11021100
| _ =>
11031101
content := content.push <| ← elabBlock b
11041102

1105-
Doc.PointOfInterest.save (← getRef) titleString
1106-
(selectionRange := (← getRef)[0])
1103+
Doc.PointOfInterest.save (← getRef) titleString (selectionSyntax? := some (← getRef)[0])
11071104

11081105
pure #[← `(Block.other {Block.syntax with data := ToJson.toJson (α := Option String × Name × String × Option Tag × Array Name) ($(quote titleString), $(quote config.name), $(quote config.getLabel), none, $(quote config.aliases.toArray))} #[Block.para #[$(title),*], $content,*])]
11091106
where
@@ -1161,11 +1158,9 @@ def freeSyntax : DirectiveExpander
11611158
| args, blocks => do
11621159
let config ← FreeSyntaxConfig.parse.run args
11631160

1164-
let title ← do
1165-
let (fm, t) := config.title
1166-
DocElabM.withFileMap fm <| t.mapM elabInline
1161+
let title ← config.title.mapM elabInline
11671162
let env ← getEnv
1168-
let titleString := inlinesToString env config.title.snd
1163+
let titleString := inlinesToString env config.title
11691164

11701165
let mut content := #[]
11711166
let mut firstGrammar := true

Manual/Releases/v4_31_0.lean

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,12 @@ open Verso.Genre.Manual
1414
open Verso.Genre.Manual.InlineLean
1515
open Lean.MessageSeverity
1616

17-
#doc (Manual) "Lean 4.31.0-rc2 (2026-06-04)" =>
17+
#doc (Manual) "Lean 4.31.0 (2026-06-13)" =>
1818
%%%
1919
tag := "release-v4.31.0"
2020
file := "v4.31.0"
2121
%%%
2222

23-
:::warn
24-
These release notes describe a _release candidate_, not the final release.
25-
They may be incomplete and are subject to change.
26-
:::
27-
2823
For this release, 305 changes landed.
2924
In addition to the 105 feature additions,
3025
and 102 fixes listed below,

lake-manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"subDir": null,
77
"scope": "",
8-
"rev": "4c6b02ee232211811f9ad1c148ac336122e256d7",
8+
"rev": "113c54a466d14d1cd1e615103aefd27ffef19b12",
99
"name": "verso",
1010
"manifestFile": "lake-manifest.json",
1111
"inputRev": "main",
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"subDir": null,
1717
"scope": "",
18-
"rev": "c7a8de81e102ee2a42a7395f98d1ed12a861a43b",
18+
"rev": "20b8493528eed2fac9827ce18d41c475f0e1c50a",
1919
"name": "illuminate",
2020
"manifestFile": "lake-manifest.json",
2121
"inputRev": "main",
@@ -25,7 +25,7 @@
2525
"type": "git",
2626
"subDir": null,
2727
"scope": "",
28-
"rev": "a252e45ae646f999c535e1056536def2c871f085",
28+
"rev": "6ca10c8b0e640e9e2c27b49b5ca9981063a2434f",
2929
"name": "versowebcomponents",
3030
"manifestFile": "lake-manifest.json",
3131
"inputRev": "main",
@@ -35,7 +35,7 @@
3535
"type": "git",
3636
"subDir": null,
3737
"scope": "",
38-
"rev": "744117af710b1c0400cd297c9ce91f8d0ad3a347",
38+
"rev": "63045536fe95024e6c18fc7b48e03f506701c5bc",
3939
"name": "plausible",
4040
"manifestFile": "lake-manifest.json",
4141
"inputRev": "main",
@@ -55,7 +55,7 @@
5555
"type": "git",
5656
"subDir": null,
5757
"scope": "",
58-
"rev": "a86770a5eba721c8554d1d7fce741bc4dde3bb61",
58+
"rev": "0bd508e8362f56d4a05cbf63614d4c97db954041",
5959
"name": "subverso",
6060
"manifestFile": "lake-manifest.json",
6161
"inputRev": "main",

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.31.0-rc2
1+
leanprover/lean4:v4.31.0

0 commit comments

Comments
 (0)