lean4-htt/src/Lean/Parser
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
..
Tactic feat: docstrings with Verso syntax (#10307) 2025-09-10 07:03:57 +00:00
Term refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Attr.lean chore: remove syntax for extern arity specifications (#9556) 2025-07-26 00:44:36 +00:00
Basic.lean feat: add unicode(...) parser syntax and pp.unicode option (#10373) 2025-09-14 04:40:03 +00:00
Command.lean feat: change delimiting of local attributes in implicit sections (#9968) 2025-08-28 15:48:42 +00:00
Do.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Extension.lean feat: add unicode(...) parser syntax and pp.unicode option (#10373) 2025-09-14 04:40:03 +00:00
Extra.lean chore: fix spelling errors (#10042) 2025-08-22 07:23:12 +00:00
Level.lean refactor: remove some unnecessary meta imports (#9542) 2025-07-25 15:14:02 +00:00
Module.lean feat: add a stop position field to the parser (#10043) 2025-08-23 18:29:51 +00:00
StrInterpolation.lean feat: docstrings with Verso syntax (#10307) 2025-09-10 07:03:57 +00:00
Syntax.lean feat: add unicode(...) parser syntax and pp.unicode option (#10373) 2025-09-14 04:40:03 +00:00
Tactic.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Term.lean feat: add unicode(...) parser syntax and pp.unicode option (#10373) 2025-09-14 04:40:03 +00:00
Types.lean feat: add a stop position field to the parser (#10043) 2025-08-23 18:29:51 +00:00