Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add initial unicodedata module.
  • Loading branch information
windelbouwman committed Jun 26, 2019
commit 4db83aca7f1e1fbc8b6f69cb230d4a8b1c0dfd7b
269 changes: 269 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions tests/snippets/unicode_fu.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@
c = ᚴ*3

assert c == '👋👋👋'

import unicodedata
assert unicodedata.category('a') == 'Ll'
assert unicodedata.category('A') == 'Lu'
assert unicodedata.name('a') == 'LATIN SMALL LETTER A'
assert unicodedata.lookup('LATIN SMALL LETTER A') == 'a'
assert unicodedata.bidirectional('a') == 'L'
assert unicodedata.normalize('NFC', 'bla') == 'bla'
2 changes: 2 additions & 0 deletions vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ indexmap = "1.0.2"
crc = "^1.0.0"
bincode = "1.1.4"
unicode_categories = "0.1.1"
unicode_names2 = "0.2.2"
unic = "0.9.0"
maplit = "1.0"
proc-macro-hack = "0.5"
bitflags = "1.1"
Expand Down
2 changes: 2 additions & 0 deletions vm/src/stdlib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mod string;
mod thread;
mod time_module;
mod tokenize;
mod unicodedata;
mod warnings;
mod weakref;
use std::collections::HashMap;
Expand Down Expand Up @@ -54,6 +55,7 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
"tokenize".to_string() => Box::new(tokenize::make_module),
"_weakref".to_string() => Box::new(weakref::make_module),
"_imp".to_string() => Box::new(imp::make_module),
"unicodedata".to_string() => Box::new(unicodedata::make_module),
"_warnings".to_string() => Box::new(warnings::make_module),
};

Expand Down
Loading