Skip to content

Commit 5ef6393

Browse files
downstream: update repo verso
downstream-repo: verso downstream-url: https://github.com/leanprover/verso downstream-rev: main downstream-sha: 5f675d7d20aa9391a7fea01429601f94e850e159
1 parent 40320dd commit 5ef6393

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

verso/src/tests/Tests/LiterateHtml.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ private def testAllBuiltinDocRoles (data : TestData) : IO Unit := withTestDir da
224224
unless hasSubstring jsonContent "\"content\":\"lhs\",\"kind\":{\"keyword\":{\"docs\":\"" do
225225
throw <| IO.userError "Builtins JSON has no docs on the `lhs` keyword token. \
226226
The conv handler did not attach the syntax kind's docstring."
227+
unless hasSubstring jsonContent "{\"content\":\"funext\",\"kind\":{\"keyword\":{\"docs\":\"" do
228+
throw <| IO.userError "Builtins JSON has no docs on the `funext` keyword token. \
229+
The kw handler did not attach the syntax kind's docstring."
227230

228231
/--
229232
Checks that user-registered `@[inline_to_literate]` and `@[block_to_literate]` handlers shadow the

verso/src/verso-literate/VersoLiterate/Basic.lean

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,13 @@ def handleConvTactic : InlineToLiterate
173173
| _, _, _ => pure none
174174

175175
def handleKwAtom : InlineToLiterate
176-
| name, _val, content => do
177-
-- Data.Atom is mistakenly marked private in Lean. Here's a workaround until we fix that.
178-
-- Check the name's suffix because private names have a mangled prefix:
179-
unless name.toString.endsWith "Lean.Doc.Data.Atom" do return none
180-
let some s := (match content with | #[.code s] => some s | _ => none) | return none
181-
return some <| .other (.highlighted <| .token ⟨.keyword none none none, s⟩) content
176+
| ``Lean.Doc.Data.Atom, val, content => do
177+
if let some { name, .. } := val.get? Lean.Doc.Data.Atom then
178+
let #[.code s] := content | return none
179+
let docs ← findDocString? (← getEnv) name
180+
return some <| .other (.highlighted <| .token ⟨.keyword (some name) none docs, s⟩) content
181+
throwError "Wrong data"
182+
| _, _, _ => pure none
182183

183184
def handleSyntax : InlineToLiterate
184185
| ``Lean.Doc.Data.Syntax, val, content => do

verso/test-projects/literate-config/LitConfig/Builtins.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ set_option doc.verso.suggestions false in
3131
3232
{syntaxCat}`term` is a syntax category, and {syntax term}`1 + [] - (· / ·)` is syntax in it.
3333
34-
{kw (of := Lean.«command__Unif_hint____Where_|_-⊢__»)}`unif_hint` is a keyword atom.
34+
{kw}`funext` is a keyword atom.
3535
{kw? (of := Lean.«command__Unif_hint____Where_|_-⊢__»)}`where` is also a keyword atom, and
3636
{kw! (of := Lean.Parser.Command.definition)}`def` is an unchecked keyword atom.
3737

0 commit comments

Comments
 (0)