Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make core app unexpanders tag tokens #6704

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Jan 20, 2025

This PR makes a number of app unexpanders tag the tokens that appear in the syntax with the head constant when in pp.tagAppFns mode. This affects docgen; for example, now links to Exists in documentation. These are the app unexpanders that have been modified:

  • Prod.mk
  • ite
  • Eq.ndrec and Eq.rec ()
  • Exists
  • Sigma
  • PSigma
  • Subtype
  • GetElem.getElem, getElem!, and getElem?
  • singleton and insert

Note that this causes all tokens to be linked. For example, the , in Exists notation is also a link to Exists.

This PR makes a number of app unexpanders tag the tokens that appear in the syntax with the head constant when in `pp.tagAppFns` mode. This affects docgen; for example, `∃` now links to `Exists` in documentation. These are the notations that have been modified:
- `Prod.mk`
- `ite`
- `Eq.ndrec` and `Eq.rec` (`▸`)
- `Exists`
- `Sigma`
- `PSigma`
- `Subtype`
- `GetElem.getElem`, `getElem!`, and `getElem?`
- `singleton` and `insert`
@kmill
Copy link
Collaborator Author

kmill commented Jan 20, 2025

Another solution could be to make app unexpanders start with the head function as the ref, removing the need for manually writing withRef.

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jan 20, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase a062eea204a9c982e318c0c98cd6af63e9f61050 --onto 74bd40d34d1a969da65007939960c2fefd461f08. (2025-01-20 02:15:01)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-pp Pretty printing toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants