lean4-htt/tests/lean/242.lean
Kyle Miller 3e4fa12c72
feat: add unicode(...) parser syntax and pp.unicode option (#10373)
This PR adds a `pp.unicode` option and a `unicode("→", "->")` syntax
description alias for the lower-level `unicodeSymbol "→" "->"` parser.
The syntax is added to the `notation` command as well. When `pp.unicode`
is true (the default) then the first form is used when pretty printing,
and otherwise the second ASCII form is used. A variant, `unicode("→",
"->", preserveForPP)` causes the `->` form to be preferred; delaborators
can insert `→` directly into the syntax, which will be pretty printed
as-is; this allows notations like `fun` to use custom options such as
`pp.unicode.fun` to opt into the unicode form when pretty printing.

Additionally:
- Adds more documentation for the `symbol` and `nonReservedSymbol`
parser descriptions.
- Adds documentation for the
`infix`/`infixr`/`infixl`/`prefix`/`postfix` commands.
- The parenthesizers for symbols are improved to backtrack if the atom
doesn't match.
- Fixes a bug where `&"..."` symbols aren't validated.

This is partial progress for issue #1056. What remains is enabling
`unicode(...)` for mixfix commands and then making use of it for core
notation.
2025-09-14 04:40:03 +00:00

17 lines
325 B
Text

syntax "0" : term
syntax "'a'" : term
syntax "`a" : term
syntax "\"a" : term
syntax " 0" : term
syntax " 'a'" : term
syntax " `a" : term
syntax " \"a" : term
syntax &"0" : term
syntax &"'a'" : term
syntax &"`a" : term
syntax &"\"a" : term
syntax &" 0" : term
syntax &" 'a'" : term
syntax &" `a" : term
syntax &" \"a" : term