Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
d3fc45e
chore: update toolchain nightly-2025-12-16
fgdorais Dec 16, 2025
6a23ff4
chore: update toolchain nightly-2025-12-17
fgdorais Dec 17, 2025
f07cd38
chore: update toolchain nightly-2025-12-17
fgdorais Dec 17, 2025
f12b035
chore: update toolchain nightly-2025-12-18
fgdorais Dec 18, 2025
7f5105d
chore: update toolchain nightly-2025-12-19
fgdorais Dec 19, 2025
b32b47e
chore: update toolchain nightly-2025-12-20
fgdorais Dec 20, 2025
01e552b
chore: update toolchain nightly-2025-12-21
fgdorais Dec 21, 2025
4a9a5f7
chore: update toolchain nightly-2025-12-22
fgdorais Dec 22, 2025
91d26c4
chore: update toolchain nightly-2025-12-23
fgdorais Dec 23, 2025
e18b07c
chore: update toolchain nightly-2025-12-24
fgdorais Dec 24, 2025
26d1e3f
chore: update toolchain nightly-2025-12-25
fgdorais Dec 25, 2025
b66d6e6
chore: update toolchain nightly-2025-12-26
fgdorais Dec 26, 2025
91933c9
chore: update toolchain nightly-2025-12-27
fgdorais Dec 27, 2025
d47e05f
chore: update toolchain nightly-2025-12-28
fgdorais Dec 28, 2025
c1d11ea
chore: update toolchain nightly-2025-12-29
fgdorais Dec 29, 2025
9ece1d3
chore: update toolchain nightly-2025-12-30
fgdorais Dec 30, 2025
02e28d6
chore: update toolchain nightly-2025-12-31
fgdorais Dec 31, 2025
79e2e8e
chore: update toolchain nightly-2026-01-01
fgdorais Jan 1, 2026
8db98ad
chore: update toolchain nightly-2026-01-02
fgdorais Jan 2, 2026
bc2b1cf
chore: update toolchain nightly-2026-01-02
fgdorais Jan 3, 2026
70000d5
chore: update toolchain nightly-2026-01-04
fgdorais Jan 4, 2026
997ce9c
chore: update toolchain nightly-2026-01-04
fgdorais Jan 5, 2026
cb2941d
chore: update toolchain nightly-2026-01-06
fgdorais Jan 6, 2026
ab094b8
chore: update toolchain nightly-2026-01-07
fgdorais Jan 7, 2026
8079285
chore: update toolchain nightly-2026-01-08
fgdorais Jan 8, 2026
8521c32
chore: update toolchain nightly-2026-01-09
fgdorais Jan 9, 2026
8649cd2
chore: update toolchain nightly-2026-01-10
fgdorais Jan 10, 2026
e63a994
chore: update toolchain nightly-2026-01-10
fgdorais Jan 11, 2026
5a4e8ea
chore: update toolchain nightly-2026-01-12
fgdorais Jan 12, 2026
37faa12
chore: update toolchain nightly-2026-01-12
fgdorais Jan 13, 2026
38cbdc1
chore: update toolchain nightly-2026-01-14
fgdorais Jan 14, 2026
e83cfad
chore: update toolchain nightly-2026-01-15
fgdorais Jan 15, 2026
0d1898e
chore: fix nightly-testing
fgdorais Jan 16, 2026
22a149c
chore: update toolchain nightly-2026-01-15
fgdorais Jan 16, 2026
c9840c4
chore: update toolchain nightly-2026-01-16
fgdorais Jan 17, 2026
e4c820d
chore: update toolchain nightly-2026-01-16
fgdorais Jan 18, 2026
734e1dd
chore: update toolchain nightly-2026-01-16
fgdorais Jan 19, 2026
413a899
chore: update toolchain nightly-2026-01-20
fgdorais Jan 20, 2026
0206d6c
chore: update toolchain nightly-2026-01-21
fgdorais Jan 21, 2026
970c330
chore: update toolchain nightly-2026-01-21
fgdorais Jan 22, 2026
dc7e55d
chore: update toolchain nightly-2026-01-23
fgdorais Jan 23, 2026
1eab76b
chore: update toolchain nightly-2026-01-24
fgdorais Jan 24, 2026
f93c218
chore: update toolchain nightly-2026-01-24
fgdorais Jan 25, 2026
b781a71
chore: update toolchain nightly-2026-01-25
fgdorais Jan 26, 2026
878990a
chore: update toolchain nightly-2026-01-27
fgdorais Jan 27, 2026
dec6f21
chore: update toolchain nightly-2026-01-28
fgdorais Jan 28, 2026
790c85e
chore: update toolchain nightly-2026-01-28
fgdorais Jan 29, 2026
86d7a16
chore: update toolchain nightly-2026-01-30
fgdorais Jan 30, 2026
24613d6
chore: update toolchain nightly-2026-01-31
fgdorais Jan 31, 2026
388935d
chore: update toolchain nightly-2026-02-01
fgdorais Feb 1, 2026
a6a31d2
chore: update toolchain nightly-2026-02-01
fgdorais Feb 2, 2026
61aa5d0
chore: update toolchain nightly-2026-02-03
fgdorais Feb 3, 2026
af68623
chore: update toolchain nightly-2026-02-03
fgdorais Feb 4, 2026
8c0cae4
chore: update toolchain nightly-2026-02-04
fgdorais Feb 5, 2026
9813a17
chore: update toolchain nightly-2026-02-05
fgdorais Feb 6, 2026
3de0f2f
chore: update toolchain nightly-2026-02-07
fgdorais Feb 7, 2026
88cc32c
chore: update toolchain nightly-2026-02-08
fgdorais Feb 8, 2026
ed8cbd0
chore: update toolchain nightly-2026-02-09
fgdorais Feb 9, 2026
1bf5b63
chore: update toolchain nightly-2026-02-09
fgdorais Feb 10, 2026
81f5e6d
chore: update toolchain nightly-2026-02-10
fgdorais Feb 11, 2026
7db732c
chore: update toolchain nightly-2026-02-11
fgdorais Feb 12, 2026
655e91f
chore: update toolchain nightly-2026-02-13-rev1
fgdorais Feb 13, 2026
1664b84
chore: update toolchain nightly-2026-02-14
fgdorais Feb 14, 2026
d76480e
chore: update toolchain nightly-2026-02-15
fgdorais Feb 15, 2026
e6d3c15
chore: update toolchain nightly-2026-02-16
fgdorais Feb 16, 2026
beccb92
fix: use String.Slice.posGT
fgdorais Feb 16, 2026
a22e4bf
chore: update toolchain nightly-2026-02-16-rev1
fgdorais Feb 17, 2026
90fcfdf
chore: update toolchain v4.29.0-rc1
fgdorais Feb 17, 2026
a58755d
chore: update toolchain nightly-2026-02-17
fgdorais Feb 18, 2026
d3fd500
chore: update toolchain nightly-2026-02-18
fgdorais Feb 19, 2026
25010b7
chore: update toolchain nightly-2026-02-19
fgdorais Feb 20, 2026
e4a3c4d
chore: update toolchain nightly-2026-02-21
fgdorais Feb 21, 2026
a916467
chore: update toolchain nightly-2026-02-22
fgdorais Feb 22, 2026
5db86a0
chore: update toolchain nightly-2026-02-22
fgdorais Feb 23, 2026
0a6c9ec
chore: update toolchain nightly-2026-02-23-rev1
fgdorais Feb 24, 2026
9e13986
chore: update toolchain nightly-2026-02-23-rev2
fgdorais Feb 25, 2026
071905b
chore: update toolchain nightly-2026-02-25
fgdorais Feb 26, 2026
cd9f023
chore: update toolchain nightly-2026-02-25
fgdorais Feb 27, 2026
ab49349
chore: update toolchain nightly-2026-02-28
fgdorais Feb 28, 2026
ff75b53
chore: update toolchain nightly-2026-03-01
fgdorais Mar 1, 2026
96e6376
chore: update toolchain nightly-2026-03-02
fgdorais Mar 2, 2026
affff4c
chore: update toolchain nightly-2026-03-03
fgdorais Mar 3, 2026
34b8f20
chore: update toolchain nightly-2026-03-04
fgdorais Mar 4, 2026
c5a9a34
chore: update toolchain nightly-2026-03-04
fgdorais Mar 5, 2026
eb78ea2
chore: update toolchain nightly-2026-03-05
fgdorais Mar 6, 2026
3533187
chore: update toolchain nightly-2026-03-07
fgdorais Mar 7, 2026
525e517
chore: update toolchain nightly-2026-03-07
fgdorais Mar 8, 2026
17c74a1
chore: update toolchain nightly-2026-03-09
fgdorais Mar 9, 2026
849343d
chore: update toolchain nightly-2026-03-09
fgdorais Mar 10, 2026
e4b3c73
chore: update toolchain nightly-2026-03-10
fgdorais Mar 11, 2026
b10baa7
chore: update toolchain nightly-2026-03-11
fgdorais Mar 12, 2026
614fae1
chore: update toolchain nightly-2026-03-12
fgdorais Mar 13, 2026
148697d
chore: update toolchain nightly-2026-03-14
fgdorais Mar 14, 2026
cf0a40d
chore: update toolchain nightly-2026-03-15
fgdorais Mar 15, 2026
35a4031
chore: update toolchain nightly-2026-03-15
fgdorais Mar 16, 2026
d23841d
chore: update toolchain nightly-2026-03-16
fgdorais Mar 17, 2026
e96cb97
chore: update toolchain nightly-2026-03-17
fgdorais Mar 18, 2026
e039d9e
chore: update toolchain nightly-2026-03-19
fgdorais Mar 19, 2026
8d1e502
chore: update toolchain nightly-2026-03-19
fgdorais Mar 20, 2026
0187bb9
chore: update toolchain nightly-2026-03-19
fgdorais Mar 21, 2026
e5430d4
chore: update toolchain nightly-2026-03-19-rev1
fgdorais Mar 22, 2026
d3329d2
fix: docstring edit
fgdorais Mar 22, 2026
f179ffa
chore: update toolchain nightly-2026-03-22
fgdorais Mar 22, 2026
37a1027
chore: update toolchain nightly-2026-03-23
fgdorais Mar 23, 2026
4718a69
chore: update toolchain nightly-2026-03-24
fgdorais Mar 24, 2026
d31c3b6
chore: update toolchain nightly-2026-03-25
fgdorais Mar 25, 2026
3c9a716
chore: update toolchain nightly-2026-03-25
fgdorais Mar 26, 2026
65fd158
chore: update toolchain nightly-2026-03-25
fgdorais Mar 27, 2026
eaf94e9
chore: update toolchain nightly-2026-03-28
fgdorais Mar 28, 2026
c47cac5
chore: update toolchain nightly-2026-03-29
fgdorais Mar 29, 2026
ed9a487
chore: update toolchain nightly-2026-03-30
fgdorais Mar 30, 2026
075a272
chore: update toolchain nightly-2026-03-31
fgdorais Mar 31, 2026
eacfb65
chore: update toolchain nightly-2026-04-01
fgdorais Apr 1, 2026
f99a804
chore: update toolchain nightly-2026-04-01
fgdorais Apr 2, 2026
5785c13
chore: update toolchain
fgdorais Dec 16, 2025
093040a
chore: update toolchain nightly-2025-12-17
fgdorais Dec 17, 2025
62ee2f0
chore: update toolchain v4.29.0-rc1
fgdorais Feb 17, 2026
0bf7c44
chore: restore commit history
fgdorais Apr 3, 2026
f71dd47
chore: update toolchain nightly-2026-04-02
fgdorais Apr 3, 2026
1a88bae
chore: update toolchain nightly-2026-04-03
fgdorais Apr 3, 2026
2cbba28
chore: update toolchain nightly-2026-04-04
fgdorais Apr 4, 2026
71bd077
chore: update toolchain nightly-2026-04-04
fgdorais Apr 5, 2026
2a05a33
chore: update toolchain nightly-2026-04-05
fgdorais Apr 6, 2026
ad31881
chore: update toolchain nightly-2026-04-06
fgdorais Apr 7, 2026
d81422a
chore: update toolchain nightly-2026-04-07
fgdorais Apr 8, 2026
64931ad
chore: update toolchain nightly-2026-04-09
fgdorais Apr 9, 2026
db1c5a7
chore: update toolchain nightly-2026-04-10
fgdorais Apr 10, 2026
205589b
chore: update toolchain nightly-2026-04-10
fgdorais Apr 11, 2026
79a6e46
patch for leanprover/lean4#13372
kim-em Apr 12, 2026
9022f96
chore: update toolchain nightly-2026-04-11
fgdorais Apr 12, 2026
25923d6
chore: update toolchain nightly-2026-04-13
fgdorais Apr 13, 2026
bf34e45
chore: update toolchain nightly-2026-04-14
fgdorais Apr 14, 2026
4546b3e
Revert patch for leanprover/lean4#13372 (#135)
kmill Apr 14, 2026
94a85f2
chore: update toolchain nightly-2026-04-15
fgdorais Apr 15, 2026
1fc856d
chore: update toolchain nightly-2026-04-16
fgdorais Apr 16, 2026
072d8c9
chore: update toolchain nightly-2026-04-17
fgdorais Apr 17, 2026
b9bc687
chore: update toolchain v4.30.0-rc2
fgdorais Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
zip -rq docs-${TAG_NAME}.zip doc doc-data

- name: Release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@v2
with:
files: |
docs/docs-${{ github.ref_name }}.tar.gz
Expand Down
21 changes: 0 additions & 21 deletions UnicodeBasic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,6 @@ namespace Unicode
@[inline]
def getName (char : Char) : String := lookupName char.val

/-!
## Script ##
-/

/-- Get character script

Unicode property: `Script`
-/
@[inline]
def getScript (char : Char) : Script := lookupScript char.val

/-- Get script name

Returns `none` if the script code is unassigned.

Unicode property: `Script`
-/
@[inline]
def getScriptName? (s : Script) : Option String :=
lookupScriptName s |>.map toString

/-!
## Bidirectional Properties ##
-/
Expand Down
21 changes: 0 additions & 21 deletions UnicodeBasic/TableLookup.lean
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ protected abbrev oMath : UInt64 := 0x800000000
@[extern "unicode_prop_lookup"]
protected opaque lookupProp (c : UInt32) : UInt64

@[extern "unicode_script_lookup"]
protected opaque lookupScript (c : UInt32) : Script

end CLib

/-- Binary search -/
Expand Down Expand Up @@ -389,22 +386,4 @@ where
str : String := include_str "../data/table/White_Space.txt"
table : Thunk <| Array (UInt32 × UInt32) := parsePropTable str

/-- Get the script of a code point using lookup table

Unicode property: `Script` -/
@[inline]
def lookupScript (c : UInt32) : Script := CLib.lookupScript c

/-- Get the name of a script

Unicode property: `Script` -/
def lookupScriptName (s : Script) : Option String.Slice :=
let table := table.get
if s.code < table[0]!.1 then none else
match table[find s.code (fun i => table[i]!.1) 0 table.size.toUSize]! with
| (c, v) => if s.code = c then some v else none
where
str : String := include_str "../data/table/Script_Name.txt"
table : Thunk <| Array (UInt32 × String.Slice) := parseTable str fun _ n => n[0]!

end Unicode
62 changes: 0 additions & 62 deletions UnicodeBasic/Types.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Copyright © 2023-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

import Std.Data.HashMap

/-- Low-level conversion from `UInt32` to `Char` (*unsafe*)

This function translates to a no-op in the compiler. However, it does not
Expand Down Expand Up @@ -1013,64 +1011,4 @@ def BidiClass.ofAbbrev! (abbr : String.Slice) : BidiClass :=
instance : Repr BidiClass where
reprPrec bc _ := s!"Unicode.BidiClass.{bc.toAbbrev}"

/-!
## Scripts ##
-/

/-- Check if valid script identifier -/
@[inline]
def Script.isValid (c : UInt32) : Bool :=
let c0 := (c >>> 24).toUInt8
let c1 := (c >>> 16).toUInt8
let c2 := (c >>> 8).toUInt8
let c3 := c.toUInt8
(c0 ≤ 'Z'.toUInt8 && 'A'.toUInt8 ≤ c0)
&& (c1 ≤ 'z'.toUInt8 && 'a'.toUInt8 ≤ c1)
&& (c2 ≤ 'z'.toUInt8 && 'a'.toUInt8 ≤ c2)
&& (c3 ≤ 'z'.toUInt8 && 'a'.toUInt8 ≤ c3)

/-- Script identifier type -/
structure Script where
code : UInt32
is_valid : Script.isValid code
deriving DecidableEq, Hashable

namespace Script

/-- Default value is `Zzzz` (`Unknown`) -/
instance : Inhabited Script where
default := {
code := (((('Z'.val <<< 8 ||| 'z'.val) <<< 8) ||| 'z'.val) <<< 8) ||| 'z'.val
is_valid := by decide
}

/-- String abbreviation of script -/
@[extern "unicode_script_to_abbrev"]
def toAbbrev : Script → String
| ⟨c, _⟩ =>
let c0 := Char.ofUInt8 (c >>> 24).toUInt8
let c1 := Char.ofUInt8 (c >>> 16).toUInt8
let c2 := Char.ofUInt8 (c >>> 8).toUInt8
let c3 := Char.ofUInt8 c.toUInt8
String.ofList [c0, c1, c2, c3]

@[extern "unicode_script_of_abbrev"]
private opaque ofAbbrevAux (abbr : String) : UInt32

/-- Get script from abbreviation -/
def ofAbbrev? (abbr : String.Slice) : Option Script :=
if abbr.utf8ByteSize = 4 then
let code := ofAbbrevAux abbr.toString
if h : Script.isValid code then
some ⟨code, h⟩
else
none
else
none

@[inline, inherit_doc ofAbbrev?]
def ofAbbrev! (abbr : String.Slice) : Script := ofAbbrev? abbr |>.get!

end Script

end Unicode
4 changes: 0 additions & 4 deletions UnicodeCLib/basic.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#include <lean/lean.h>
#ifdef _WIN32
#include <winsock2.h>
#else
#include <arpa/inet.h>
#endif
#include "basic.h"

static inline int unicode_script_is_valid(uint32_t c) {
Expand Down
6 changes: 0 additions & 6 deletions UnicodeCLib/basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ LEAN_EXPORT uint64_t unicode_prop_lookup(uint32_t c);

LEAN_EXPORT uint64_t unicode_case_lookup(uint32_t c);

LEAN_EXPORT uint32_t unicode_script_lookup(uint32_t c);

LEAN_EXPORT uint32_t unicode_script_of_abbrev(b_lean_obj_arg abbr);

LEAN_EXPORT lean_obj_res unicode_script_to_abbrev(uint32_t scr);

#ifdef __cplusplus
}
#endif
1 change: 0 additions & 1 deletion UnicodeData.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ Released under Apache 2.0 license as described in the file LICENSE.
import UnicodeData.Aliases
import UnicodeData.Basic
import UnicodeData.PropList
import UnicodeData.Scripts
1 change: 0 additions & 1 deletion lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ script updateUCD do downloadUCD [
"PropList.txt",
"PropertyAliases.txt",
"PropertyValueAliases.txt",
"Scripts.txt",
]
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:v4.30.0-rc1
leanprover/lean4:v4.30.0-rc2
38 changes: 0 additions & 38 deletions makeCLib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -191,45 +191,7 @@ static const unicode_data_t table[] = {"
file.putStrLn s!"\{UINT32_C({c₀}),UINT32_C({c₁}),UINT64_C({d})},"
file.putStrLn "};"

def scriptTable : Array (UInt32 × UInt32 × UInt64) :=
let t := Scripts.data.toArray.flatMap fun (sc, t) =>
let sc := Script.ofAbbrev! <| PropertyValueAliases.getShortName! "sc" sc
t.map fun (c₀, c₁) => (c₀, c₁, sc.code.toUInt64)
t.qsort fun (a, _) (b, _) => a < b

def makeScriptC : IO Unit :=
IO.FS.withFile (clibDir / "script.c") .write fun file => do
file.putStrLn s!"/* THIS IS A GENERATED FILE - DO NOT EDIT */
#include \"basic.h\"

#define TABLE_SIZE {scriptTable.size}
#define SCRIPT_UNKNOWN UINT32_C({Script.ofAbbrev! "Zzzz" |>.code})"
file.putStrLn "
static const unicode_data_t table[TABLE_SIZE];

uint32_t unicode_script_lookup(uint32_t c) {
unicode_data_t v;
if (c >= table[0].cmin) {
unsigned int lo = 0;
unsigned int hi = TABLE_SIZE;
unsigned int i = (lo + hi)/2;
while (i != lo) {
if (c < table[i].cmin) hi = i;
else lo = i;
i = (lo + hi)/2;
}
if (c <= table[i].cmax) return (uint32_t)table[i].data;
}
return SCRIPT_UNKNOWN;
}

static const unicode_data_t table[] = {"
for (c₀, c₁, d) in scriptTable do
file.putStrLn s!"\{UINT32_C({c₀}),UINT32_C({c₁}),UINT64_C({d})},"
file.putStrLn "};"

def main : IO UInt32 := do
makeCaseC
makePropC
makeScriptC
return 0
14 changes: 0 additions & 14 deletions makeTables.lean
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,6 @@ def mkWhiteSpace : Array (UInt32 × UInt32) :=
| (c₀, some c₁) => (c₀, c₁)
| (c₀, none) => (c₀, c₀)

def mkScriptName : Array (UInt32 × String) :=
let t := PropertyAliases.getValues! "Script" |>.map fun name =>
let s := Script.ofAbbrev! <| PropertyValueAliases.getShortName! "Script" name
(s.code, name.toString)
t.qsort fun (a, _) (b, _) => a < b

def main (args : List String) : IO UInt32 := do
let args := if args != [] then args else [
"Bidi_Class",
Expand All @@ -536,7 +530,6 @@ def main (args : List String) : IO UInt32 := do
"Default_Ignorable_Code_Point",
"Name",
"Numeric_Value",
"Script_Name",
"White_Space"]
let tableDir : System.FilePath := "."/"data"/"table"
IO.FS.createDirAll tableDir
Expand Down Expand Up @@ -774,13 +767,6 @@ def main (args : List String) : IO UInt32 := do
else
file.putStrLn <| toHexStringAux c₀ ++ ";" ++ toHexStringAux c₁
IO.println s!"Size: {(statsProp table).1} + {(statsProp table).2}"
| "Script_Name" =>
IO.println s!"Generating table {arg}"
let table := mkScriptName
IO.FS.withFile (tableDir/(arg ++ ".txt")) .write fun file => do
for (c, name) in table do
file.putStrLn <| toHexStringAux c ++ ";" ++ name
IO.println s!"Size: {table.size}"
| "Titlecase" =>
IO.println s!"Generating table {arg}"
let table ← mkTitlecase
Expand Down
Loading