lean4-htt/tests/lean/run/versoDocParseError.lean
David Thrane Christiansen b397d466b4
fix: report Verso docsring parse errors (#12314)
This PR fixes a problem where Verso docstring parse errors were being
swallowed in some circumstances.

Closes #12062.
2026-02-04 18:46:31 +00:00

45 lines
709 B
Text

import Lean
set_option doc.verso true
/-!
This test ensures that syntax errors in Verso docs are appropriately reported.
-/
-- Syntax error in module docstring should report actual error location
/--
error: '}'
---
error: unexpected end of input; expected '![', '$$', '$', '[' or '[^'
-/
#guard_msgs in
/-!
Here is text with an unclosed role {name`Nat
-/
-- Syntax error with specific position (not at end of docstring)
/--
@ +2:27...*
error: '*'
-/
#guard_msgs (positions := true) in
/-!
Some mismatched *formatting_
A b c d e f.
```
-/
-- Syntax error in a normal docstring
/--
@ +2:27...*
error: '*'
-/
#guard_msgs (positions := true) in
/--
Some mismatched *formatting_
A b c d e f.
-/
def x := 5