Skip to content

Commit

Permalink
fix: allow ⱼ in identifiers (leanprover#6679)
Browse files Browse the repository at this point in the history
This PR changes the identifier parser to allow for the ⱼ unicode
character which was forgotten as it lives by itself in a codeblock with
coptic characters.
  • Loading branch information
hargoniX authored and luisacicolini committed Jan 21, 2025
1 parent 05b64be commit 6e16649
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Init/Meta.lean
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def isLetterLike (c : Char) : Bool :=
def isSubScriptAlnum (c : Char) : Bool :=
isNumericSubscript c ||
(0x2090 ≤ c.val && c.val ≤ 0x209c) ||
(0x1d62 ≤ c.val && c.val ≤ 0x1d6a)
(0x1d62 ≤ c.val && c.val ≤ 0x1d6a) ||
c.val == 0x2c7c

@[inline] def isIdFirst (c : Char) : Bool :=
c.isAlpha || c = '_' || isLetterLike c
Expand Down
18 changes: 18 additions & 0 deletions tests/lean/run/subscript_parser.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- test that we accept all unicode subscripts
def fₐ : Nat := 0
def fₑ : Nat := 0
def fₕ : Nat := 0
def fᵢ : Nat := 0
def fⱼ : Nat := 0
def fₖ : Nat := 0
def fₗ : Nat := 0
def fₘ : Nat := 0
def fₙ : Nat := 0
def fₒ : Nat := 0
def fₚ : Nat := 0
def fᵣ : Nat := 0
def fₛ : Nat := 0
def fₜ : Nat := 0
def fᵤ : Nat := 0
def fᵥ : Nat := 0
def fₓ : Nat := 0

0 comments on commit 6e16649

Please sign in to comment.