Skip to content

feat: XID support in Lean identifiers#12726

Draft
hargoniX wants to merge 1 commit intomasterfrom
hbv/xid
Draft

feat: XID support in Lean identifiers#12726
hargoniX wants to merge 1 commit intomasterfrom
hbv/xid

Conversation

@hargoniX
Copy link
Contributor

  • step1
  • step2
  • feat: XID identifier support

@hargoniX
Copy link
Contributor Author

!bench

@leanprover-radar
Copy link

leanprover-radar commented Feb 27, 2026

Benchmark results for 4fce392 against 9843794 are in! @hargoniX

  • 🟥 build exited with code 2
  • 🟥 other exited with code 2

No significant changes detected.

@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 Feb 27, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 9843794e3f269b65bdce1fc72c373b77b8442750 --onto 87ec768a509c45987a7d73258da0cc1ef047925c. You can force Mathlib CI using the force-mathlib-ci label. (2026-02-27 14:59:13)

@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 9843794e3f269b65bdce1fc72c373b77b8442750 --onto 8038a8b8904f89ad9542c8eda11379f8f006eab1. You can force reference manual CI using the force-manual-ci label. (2026-02-27 14:59:14)


@[inline] def isIdRest (c : Char) : Bool :=
c.isAlphanum || c = '_' || c = '\'' || c == '!' || c == '?' || isLetterLike c || isSubScriptAlnum c
c.isAlphanum || c = '_' || c = '\'' || c == '!' || c == '?' || c.isXID_Continue
Copy link
Contributor

@Rob23oba Rob23oba Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget subscript alnum!
Edit: or really numeric subscript since the others are already included
Edit 2: and it seems like we'll have to exclude the superscript alphabet (for e.g. ᵒᵈ). Not sure about lambda, pi and sigma since they might be good to have for Greek people using Lean

| `($cmd₁ in%$tk $cmd₂) =>
-- Limit ref variability for incrementality; see Note [Incremental Macros]
withRef tk `(section $cmd₁:command $endLocalScopeSyntax:command $cmd₂ end)
withRef tk `(section Aux $cmd₁:command $endLocalScopeSyntax:command $cmd₂ end Aux)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this? It seems like section doesn't like macro scopes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants