Skip to content

Commit 89f5f55

Browse files
bors[bot]behnam
andcommitted
Merge #258
258: Release v0.9.0 r=behnam a=behnam ### Add - `unic-ucd-name_aliases`: Unicode Name Alias character properties. ### Changed - `unic-cli`: Fallback to Name Alias for characters without Name value. ### Fixed - `ucd-ident`: Use correct data table for `PatternWhitespace` property. [[GH-254](#254)] ### Misc - Use external git submodules for source data. - Migrate to Rust 2018 Edition. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/open-i18n/rust-unic/258) <!-- Reviewable:end --> Co-authored-by: Behnam Esfahbod <[email protected]>
2 parents 2fa4706 + 8a6ce83 commit 89f5f55

File tree

38 files changed

+170
-155
lines changed

38 files changed

+170
-155
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33

44
## [Unreleased]
5-
[Unreleased]: https://github.com/open-i18n/rust-unic/compare/v0.8.0...HEAD
5+
[Unreleased]: https://github.com/open-i18n/rust-unic/compare/v0.9.0...HEAD
6+
7+
8+
## [v0.9.0] - 2019-03-02
9+
[v0.9.0]: https://github.com/open-i18n/rust-unic/compare/v0.8.0...v0.9.0
610

711
### Add
812

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ In `Cargo.toml`:
167167

168168
```toml
169169
[dependencies]
170-
unic = "0.8.0" # This has Unicode 10.0.0 data and algorithms
170+
unic = "0.9.0" # This has Unicode 10.0.0 data and algorithms
171171
```
172172

173173
And in `main.rs`:

apps/cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unic-cli"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
edition = "2018"
55
authors = ["The UNIC Project Developers"]
66
repository = "https://github.com/open-i18n/rust-unic/"
@@ -11,7 +11,7 @@ categories = ["internationalization", "text-processing", "parsing", "command-lin
1111
readme = "README.md"
1212

1313
[dependencies]
14-
unic = { path = "../../unic/", version = "0.8.0" }
14+
unic = { path = "../../unic/", version = "0.9.0" }
1515

1616
clap = "2.29"
1717
lazy_static = "1.0"

etc/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ set -e
1717
export COMPONENTS="
1818
unic/common
1919
20-
unic/char/basics
2120
unic/char/range
2221
22+
unic/char/basics
2323
unic/char/property
2424
2525
unic/char
@@ -36,6 +36,7 @@ export COMPONENTS="
3636
unic/ucd/common
3737
unic/ucd/ident
3838
unic/ucd/name
39+
unic/ucd/name_aliases
3940
unic/ucd/normal
4041
unic/ucd/segment
4142

gen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "UNIC — Table Generation"
99
publish = false
1010

1111
[dependencies]
12-
unic-char-range = { path = "../unic/char/range/", version = "0.8.0" }
12+
unic-char-range = { path = "../unic/char/range/", version = "0.9.0" }
1313

1414
# Command line argument parsing
1515
clap = "2.29"

gen/src/source/ucd/name_aliases.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ use regex::Regex;
1818
use crate::source::utils::read;
1919

2020
// String constants representing name alias types
21-
// Note: The string corresponds to unic_name_aliases::NameAliasType enum cases
21+
// Note: The string corresponds to unic_ucd_name_aliases::NameAliasType enum cases
2222
static TYPE_STR_CORRECTIONS: &str = "NameCorrections";
2323
static TYPE_STR_CONTROLS: &str = "ControlCodeNames";
2424
static TYPE_STR_ALTERNATES: &str = "AlternateNames";
2525
static TYPE_STR_FIGMENTS: &str = "Figments";
2626
static TYPE_STR_ABBREVIATIONS: &str = "NameAbbreviations";
2727

2828
lazy_static! {
29-
pub static ref NAME_ALIASES_DATA: NameAliasesData =
30-
{ read("external/unicode/ucd/data/NameAliases.txt").parse().unwrap() };
29+
pub static ref NAME_ALIASES_DATA: NameAliasesData = {
30+
read("external/unicode/ucd/data/NameAliases.txt")
31+
.parse()
32+
.unwrap()
33+
};
3134
}
3235

3336
#[derive(Clone, Default, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
@@ -54,7 +57,8 @@ impl FromStr for NameAliasesData {
5457
;([[:alnum:]\ \-]*) # alias
5558
;([[:alpha:]]*) # type
5659
",
57-
).unwrap();
60+
)
61+
.unwrap();
5862
}
5963

6064
let mut name_alias_types: BTreeMap<char, Vec<String>> = BTreeMap::default();
@@ -73,9 +77,9 @@ impl FromStr for NameAliasesData {
7377
if $map.contains_key(&chr) {
7478
if let Some(values) = $map.get_mut(&chr) {
7579
// Check for duplications because this macro is also used
76-
// for inserting types strings to name_alias_types.
77-
// In case of a character having multiple values for the
78-
// same type, if we don't check for duplications, the type
80+
// for inserting types strings to name_alias_types.
81+
// In case of a character having multiple values for the
82+
// same type, if we don't check for duplications, the type
7983
// string would be inserted more than once.
8084
if !values.contains(&$value) {
8185
values.push($value);
@@ -84,7 +88,7 @@ impl FromStr for NameAliasesData {
8488
} else {
8589
$map.insert(chr, vec![$value]);
8690
}
87-
}
91+
};
8892
}
8993

9094
let alias = capture[2].to_owned();
@@ -119,7 +123,7 @@ impl FromStr for NameAliasesData {
119123
controls,
120124
alternates,
121125
figments,
122-
abbreviations
126+
abbreviations,
123127
})
124128
}
125129
}

gen/src/writer/ucd/name_aliases.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ fn emit_unified_name_aliases_table(dir: &Path) {
2727
write(
2828
dir,
2929
"name_alias_types.rsv",
30-
&NAME_ALIASES_DATA.name_alias_types.to_direct_char_table(|alias_types, f| {
31-
write!(
32-
f,
33-
"&[{}]",
34-
alias_types
35-
.iter()
36-
.map(|alias_type_str| format!("{}", alias_type_str.to_owned()))
37-
.collect::<Vec<_>>()
38-
.join(", ")
39-
)
40-
}),
30+
&NAME_ALIASES_DATA
31+
.name_alias_types
32+
.to_direct_char_table(|alias_types, f| {
33+
write!(
34+
f,
35+
"&[{}]",
36+
alias_types
37+
.iter()
38+
.map(|alias_type_str| format!("{}", alias_type_str.to_owned()))
39+
.collect::<Vec<_>>()
40+
.join(", ")
41+
)
42+
}),
4143
);
4244
}
4345

@@ -59,7 +61,7 @@ fn emit_name_aliases_table(dir: &Path) {
5961
)
6062
}),
6163
);
62-
}
64+
};
6365
}
6466

6567
write_map_to_file!(corrections, "corrections.rsv");

unic/Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unic"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
edition = "2018"
55
authors = ["The UNIC Project Developers"]
66
repository = "https://github.com/open-i18n/rust-unic/"
@@ -20,17 +20,17 @@ bench_it = ["unic-bidi/bench_it"]
2020
serde = ["unic-bidi/serde"]
2121

2222
[dependencies]
23-
unic-bidi = { path = "bidi/", version = "0.8.0" }
24-
unic-char = { path = "char/", version = "0.8.0", features = ["std"] }
25-
unic-common = { path = "common/", version = "0.8.0" }
26-
unic-emoji = { path = "emoji/", version = "0.8.0" }
27-
unic-idna = { path = "idna/", version = "0.8.0" }
28-
unic-normal = { path = "normal/", version = "0.8.0" }
29-
unic-segment = { path = "segment/", version = "0.8.0" }
30-
unic-ucd = { path = "ucd/", version = "0.8.0" }
23+
unic-bidi = { path = "bidi/", version = "0.9.0" }
24+
unic-char = { path = "char/", version = "0.9.0", features = ["std"] }
25+
unic-common = { path = "common/", version = "0.9.0" }
26+
unic-emoji = { path = "emoji/", version = "0.9.0" }
27+
unic-idna = { path = "idna/", version = "0.9.0" }
28+
unic-normal = { path = "normal/", version = "0.9.0" }
29+
unic-segment = { path = "segment/", version = "0.9.0" }
30+
unic-ucd = { path = "ucd/", version = "0.9.0" }
3131

3232
[dev-dependencies]
33-
unic-char-range = { path = "char/range/", version = "0.8.0" }
33+
unic-char-range = { path = "char/range/", version = "0.9.0" }
3434

3535
[badges]
3636
maintenance = { status = "actively-developed" }

unic/bidi/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unic-bidi"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
edition = "2018"
55
authors = ["The UNIC Project Developers"]
66
repository = "https://github.com/open-i18n/rust-unic/"
@@ -23,12 +23,12 @@ bench_it = []
2323
[dependencies]
2424
matches = "0.1"
2525
serde = { version = ">=0.8, <2.0", optional = true, features = ["derive"] }
26-
unic-ucd-bidi = { path = "../ucd/bidi/", version = "0.8.0" }
26+
unic-ucd-bidi = { path = "../ucd/bidi/", version = "0.9.0" }
2727

2828
[dev-dependencies]
2929
serde_test = ">=0.8, <2.0"
30-
unic-char-property = { path = "../char/property/", version = "0.8.0" }
31-
unic-ucd-version = { path = "../ucd/version/", version = "0.8.0" }
30+
unic-char-property = { path = "../char/property/", version = "0.9.0" }
31+
unic-ucd-version = { path = "../ucd/version/", version = "0.9.0" }
3232

3333
[badges]
3434
maintenance = { status = "actively-developed" }

unic/char/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unic-char"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
edition = "2018"
55
authors = ["The UNIC Project Developers"]
66
repository = "https://github.com/open-i18n/rust-unic/"
@@ -18,9 +18,9 @@ default = []
1818
std = ["unic-char-range/std"]
1919

2020
[dependencies]
21-
unic-char-basics = { path = "basics/", version = "0.8.0" }
22-
unic-char-property = { path = "property/", version = "0.8.0" }
23-
unic-char-range = { path = "range/", version = "0.8.0" }
21+
unic-char-basics = { path = "basics/", version = "0.9.0" }
22+
unic-char-property = { path = "property/", version = "0.9.0" }
23+
unic-char-range = { path = "range/", version = "0.9.0" }
2424

2525
[badges]
2626
maintenance = { status = "actively-developed" }

0 commit comments

Comments
 (0)