-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00032d6
commit 58b3a7e
Showing
2 changed files
with
104 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,42 @@ | ||
module numem.unicode; | ||
import numem.mem.vector; | ||
|
||
/** | ||
A unicode codepoint | ||
*/ | ||
alias codepoint = uint; | ||
alias codepoint = uint; | ||
|
||
/** | ||
A unicode codepoint sequence | ||
*/ | ||
alias UnicodeSequence = vector!codepoint; | ||
|
||
/** | ||
A unicode codepoint sequence | ||
*/ | ||
alias UnicodeSlice = codepoint[]; | ||
|
||
/** | ||
A unicode grapheme | ||
*/ | ||
struct Grapheme { | ||
private: | ||
size_t state; | ||
|
||
public: | ||
|
||
/** | ||
Byte offset | ||
*/ | ||
size_t offset; | ||
|
||
/** | ||
Cluster of codepoints, memory beloning to the original UnicodeSequence | ||
*/ | ||
codepoint[] cluster; | ||
} | ||
|
||
/** | ||
A sequence of graphemes | ||
*/ | ||
alias GraphemeSequence = weak_vector!Grapheme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters