Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions UnicodeBasic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ Copyright © 2023-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

import UnicodeBasic.Types
import UnicodeBasic.TableLookup
module
public import UnicodeBasic.Types
import all UnicodeBasic.TableLookup

/-!
# General API #
Expand Down
4 changes: 3 additions & 1 deletion UnicodeBasic/CharacterDatabase.lean
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/-
Copyright © 2023 François G. Dorais. All rights reserved.
Copyright © 2023-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

module

namespace Unicode

/-- Stream type for Unicode Character Database (UCD) files
Expand Down
4 changes: 3 additions & 1 deletion UnicodeBasic/Hangul.lean
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/-
Copyright © 2024 François G. Dorais. All rights reserved.
Copyright © 2024-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

module

namespace Unicode.Hangul

private def shortNameL : Array String :=
Expand Down
7 changes: 4 additions & 3 deletions UnicodeBasic/TableLookup.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ Copyright © 2024-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

import UnicodeBasic.CharacterDatabase
import UnicodeBasic.Hangul
import UnicodeBasic.Types
module
public import UnicodeBasic.Types
import all UnicodeBasic.CharacterDatabase
import all UnicodeBasic.Hangul

namespace Unicode

Expand Down
5 changes: 4 additions & 1 deletion UnicodeBasic/Types.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Copyright © 2023-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

module
@[expose] public section

/-- 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 @@ -312,7 +315,7 @@ def mk : (major : MajorGeneralCategory) → Option (MinorGeneralCategory major)
| _, some .privateUse => .Co
| _, some .unassigned => .Cn

private def reprAux (x : GC) (extra := false) : List String := Id.run do
def reprAux (x : GC) (extra := false) : List String := Id.run do
let mut c := #[]
if .L ⊆ x then
c := c.push "L"
Expand Down
7 changes: 4 additions & 3 deletions UnicodeData.lean
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/-
Copyright © 2023-2024 François G. Dorais. All rights reserved.
Copyright © 2023-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

import UnicodeData.Basic
import UnicodeData.PropList
module
public import UnicodeData.Basic
public import UnicodeData.PropList
7 changes: 4 additions & 3 deletions UnicodeData/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ Copyright © 2023-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

import UnicodeBasic.CharacterDatabase
import UnicodeBasic.Hangul
import UnicodeBasic.Types
module
public import UnicodeBasic.Types
import all UnicodeBasic.CharacterDatabase
import all UnicodeBasic.Hangul

namespace Unicode

Expand Down
7 changes: 4 additions & 3 deletions UnicodeData/PropList.lean
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/-
Copyright © 2023-2024 François G. Dorais. All rights reserved.
Copyright © 2023-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

import UnicodeBasic.Types
import UnicodeBasic.CharacterDatabase
module
public import UnicodeBasic.Types
import all UnicodeBasic.CharacterDatabase

namespace Unicode

Expand Down
5 changes: 3 additions & 2 deletions lookup.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ Copyright © 2023-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

module
import UnicodeBasic
import UnicodeData
import all UnicodeData.Basic

open Unicode

def main (args : List String) : IO Unit := do
public def main (args : List String) : IO Unit := do
for a in args do
match getArg? a with
| none => IO.println s!"invalid argument: {a}"
Expand Down
11 changes: 9 additions & 2 deletions makeCLib.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import UnicodeData
/-
Copyright © 2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

module
import all UnicodeData.Basic
import all UnicodeData.PropList

open Unicode

Expand Down Expand Up @@ -191,7 +198,7 @@ static const unicode_data_t table[] = {"
file.putStrLn s!"\{UINT32_C({c₀}),UINT32_C({c₁}),UINT64_C({d})},"
file.putStrLn "};"

def main : IO UInt32 := do
public def main : IO UInt32 := do
makeCaseC
makePropC
return 0
6 changes: 4 additions & 2 deletions makeTables.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Copyright © 2024-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

import UnicodeData
module
import all UnicodeData.Basic
import all UnicodeData.PropList

open Unicode

Expand Down Expand Up @@ -483,7 +485,7 @@ def mkWhiteSpace : Array (UInt32 × UInt32) :=
| (c₀, some c₁) => (c₀, c₁)
| (c₀, none) => (c₀, c₀)

def main (args : List String) : IO UInt32 := do
public def main (args : List String) : IO UInt32 := do
let args := if args != [] then args else [
"Bidi_Class",
"Bidi_Mirrored",
Expand Down
7 changes: 5 additions & 2 deletions testTables.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ Copyright © 2024-2025 François G. Dorais. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/

module
import UnicodeBasic
import UnicodeData
import all UnicodeBasic.TableLookup
import all UnicodeData.Basic
import all UnicodeData.PropList

open Unicode

Expand Down Expand Up @@ -115,7 +118,7 @@ def tests : Array (String × (UnicodeData → Bool)) := #[
("General_Category", testGeneralCategory),
("White_Space", testWhiteSpace)]

def main (args : List String) : IO UInt32 := do
public def main (args : List String) : IO UInt32 := do
let args := if args.isEmpty then tests.map Prod.fst else args.toArray
let stream : UnicodeDataStream := {}
let mut err : UInt32 := 0
Expand Down