Skip to content

Commit

Permalink
Merge #258
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bors[bot] and behnam committed Mar 3, 2019
2 parents 2fa4706 + 8a6ce83 commit 89f5f55
Show file tree
Hide file tree
Showing 38 changed files with 170 additions and 155 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@


## [Unreleased]
[Unreleased]: https://github.com/open-i18n/rust-unic/compare/v0.8.0...HEAD
[Unreleased]: https://github.com/open-i18n/rust-unic/compare/v0.9.0...HEAD


## [v0.9.0] - 2019-03-02
[v0.9.0]: https://github.com/open-i18n/rust-unic/compare/v0.8.0...v0.9.0

### Add

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ In `Cargo.toml`:

```toml
[dependencies]
unic = "0.8.0" # This has Unicode 10.0.0 data and algorithms
unic = "0.9.0" # This has Unicode 10.0.0 data and algorithms
```

And in `main.rs`:
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-cli"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -11,7 +11,7 @@ categories = ["internationalization", "text-processing", "parsing", "command-lin
readme = "README.md"

[dependencies]
unic = { path = "../../unic/", version = "0.8.0" }
unic = { path = "../../unic/", version = "0.9.0" }

clap = "2.29"
lazy_static = "1.0"
Expand Down
3 changes: 2 additions & 1 deletion etc/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ set -e
export COMPONENTS="
unic/common
unic/char/basics
unic/char/range
unic/char/basics
unic/char/property
unic/char
Expand All @@ -36,6 +36,7 @@ export COMPONENTS="
unic/ucd/common
unic/ucd/ident
unic/ucd/name
unic/ucd/name_aliases
unic/ucd/normal
unic/ucd/segment
Expand Down
2 changes: 1 addition & 1 deletion gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "UNIC — Table Generation"
publish = false

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

# Command line argument parsing
clap = "2.29"
Expand Down
22 changes: 13 additions & 9 deletions gen/src/source/ucd/name_aliases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ use regex::Regex;
use crate::source::utils::read;

// String constants representing name alias types
// Note: The string corresponds to unic_name_aliases::NameAliasType enum cases
// Note: The string corresponds to unic_ucd_name_aliases::NameAliasType enum cases
static TYPE_STR_CORRECTIONS: &str = "NameCorrections";
static TYPE_STR_CONTROLS: &str = "ControlCodeNames";
static TYPE_STR_ALTERNATES: &str = "AlternateNames";
static TYPE_STR_FIGMENTS: &str = "Figments";
static TYPE_STR_ABBREVIATIONS: &str = "NameAbbreviations";

lazy_static! {
pub static ref NAME_ALIASES_DATA: NameAliasesData =
{ read("external/unicode/ucd/data/NameAliases.txt").parse().unwrap() };
pub static ref NAME_ALIASES_DATA: NameAliasesData = {
read("external/unicode/ucd/data/NameAliases.txt")
.parse()
.unwrap()
};
}

#[derive(Clone, Default, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
Expand All @@ -54,7 +57,8 @@ impl FromStr for NameAliasesData {
;([[:alnum:]\ \-]*) # alias
;([[:alpha:]]*) # type
",
).unwrap();
)
.unwrap();
}

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

let alias = capture[2].to_owned();
Expand Down Expand Up @@ -119,7 +123,7 @@ impl FromStr for NameAliasesData {
controls,
alternates,
figments,
abbreviations
abbreviations,
})
}
}
26 changes: 14 additions & 12 deletions gen/src/writer/ucd/name_aliases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ fn emit_unified_name_aliases_table(dir: &Path) {
write(
dir,
"name_alias_types.rsv",
&NAME_ALIASES_DATA.name_alias_types.to_direct_char_table(|alias_types, f| {
write!(
f,
"&[{}]",
alias_types
.iter()
.map(|alias_type_str| format!("{}", alias_type_str.to_owned()))
.collect::<Vec<_>>()
.join(", ")
)
}),
&NAME_ALIASES_DATA
.name_alias_types
.to_direct_char_table(|alias_types, f| {
write!(
f,
"&[{}]",
alias_types
.iter()
.map(|alias_type_str| format!("{}", alias_type_str.to_owned()))
.collect::<Vec<_>>()
.join(", ")
)
}),
);
}

Expand All @@ -59,7 +61,7 @@ fn emit_name_aliases_table(dir: &Path) {
)
}),
);
}
};
}

write_map_to_file!(corrections, "corrections.rsv");
Expand Down
20 changes: 10 additions & 10 deletions unic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -20,17 +20,17 @@ bench_it = ["unic-bidi/bench_it"]
serde = ["unic-bidi/serde"]

[dependencies]
unic-bidi = { path = "bidi/", version = "0.8.0" }
unic-char = { path = "char/", version = "0.8.0", features = ["std"] }
unic-common = { path = "common/", version = "0.8.0" }
unic-emoji = { path = "emoji/", version = "0.8.0" }
unic-idna = { path = "idna/", version = "0.8.0" }
unic-normal = { path = "normal/", version = "0.8.0" }
unic-segment = { path = "segment/", version = "0.8.0" }
unic-ucd = { path = "ucd/", version = "0.8.0" }
unic-bidi = { path = "bidi/", version = "0.9.0" }
unic-char = { path = "char/", version = "0.9.0", features = ["std"] }
unic-common = { path = "common/", version = "0.9.0" }
unic-emoji = { path = "emoji/", version = "0.9.0" }
unic-idna = { path = "idna/", version = "0.9.0" }
unic-normal = { path = "normal/", version = "0.9.0" }
unic-segment = { path = "segment/", version = "0.9.0" }
unic-ucd = { path = "ucd/", version = "0.9.0" }

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

[badges]
maintenance = { status = "actively-developed" }
Expand Down
8 changes: 4 additions & 4 deletions unic/bidi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-bidi"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -23,12 +23,12 @@ bench_it = []
[dependencies]
matches = "0.1"
serde = { version = ">=0.8, <2.0", optional = true, features = ["derive"] }
unic-ucd-bidi = { path = "../ucd/bidi/", version = "0.8.0" }
unic-ucd-bidi = { path = "../ucd/bidi/", version = "0.9.0" }

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

[badges]
maintenance = { status = "actively-developed" }
Expand Down
8 changes: 4 additions & 4 deletions unic/char/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-char"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -18,9 +18,9 @@ default = []
std = ["unic-char-range/std"]

[dependencies]
unic-char-basics = { path = "basics/", version = "0.8.0" }
unic-char-property = { path = "property/", version = "0.8.0" }
unic-char-range = { path = "range/", version = "0.8.0" }
unic-char-basics = { path = "basics/", version = "0.9.0" }
unic-char-property = { path = "property/", version = "0.9.0" }
unic-char-range = { path = "range/", version = "0.9.0" }

[badges]
maintenance = { status = "actively-developed" }
Expand Down
4 changes: 2 additions & 2 deletions unic/char/basics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-char-basics"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -14,7 +14,7 @@ readme = "README.md"
exclude = []

[dev-dependencies]
unic-char-range = { path = "../range/", version = "0.8.0" }
unic-char-range = { path = "../range/", version = "0.9.0" }

[badges]
maintenance = { status = "actively-developed" }
Expand Down
4 changes: 2 additions & 2 deletions unic/char/property/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-char-property"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -13,7 +13,7 @@ categories = ["internationalization", "text-processing", "parsing"]
exclude = []

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

[badges]
maintenance = { status = "actively-developed" }
Expand Down
2 changes: 1 addition & 1 deletion unic/char/range/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-char-range"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand Down
2 changes: 1 addition & 1 deletion unic/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-common"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand Down
4 changes: 2 additions & 2 deletions unic/emoji/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-emoji"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -13,7 +13,7 @@ categories = ["internationalization", "text-processing", "parsing", "rendering"]
exclude = []

[dependencies]
unic-emoji-char = { path = "char/", version = "0.8.0" }
unic-emoji-char = { path = "char/", version = "0.9.0" }

[badges]
maintenance = { status = "actively-developed" }
Expand Down
8 changes: 4 additions & 4 deletions unic/emoji/char/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-emoji-char"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -13,9 +13,9 @@ categories = ["internationalization", "text-processing", "parsing", "rendering"]
exclude = []

[dependencies]
unic-char-property = { path = "../../char/property/", version = "0.8.0" }
unic-char-range = { path = "../../char/range", version = "0.8.0" }
unic-ucd-version = { path = "../../ucd/version/", version = "0.8.0" }
unic-char-property = { path = "../../char/property/", version = "0.9.0" }
unic-char-range = { path = "../../char/range", version = "0.9.0" }
unic-ucd-version = { path = "../../ucd/version/", version = "0.9.0" }

[badges]
maintenance = { status = "actively-developed" }
Expand Down
14 changes: 7 additions & 7 deletions unic/idna/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-idna"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -15,12 +15,12 @@ exclude = ["tests/conformance_tests.rs"]

[dependencies]
matches = "0.1"
unic-idna-punycode = { path = "punycode/", version = "0.8.0" }
unic-idna-mapping = { path = "mapping/", version = "0.8.0" }
unic-normal = { path = "../normal/", version = "0.8.0" }
unic-ucd-bidi = { path = "../ucd/bidi/", version = "0.8.0" }
unic-ucd-normal = { path = "../ucd/normal/", version = "0.8.0" }
unic-ucd-version = { path = "../ucd/version/", version = "0.8.0" }
unic-idna-punycode = { path = "punycode/", version = "0.9.0" }
unic-idna-mapping = { path = "mapping/", version = "0.9.0" }
unic-normal = { path = "../normal/", version = "0.9.0" }
unic-ucd-bidi = { path = "../ucd/bidi/", version = "0.9.0" }
unic-ucd-normal = { path = "../ucd/normal/", version = "0.9.0" }
unic-ucd-version = { path = "../ucd/version/", version = "0.9.0" }

[badges]
maintenance = { status = "actively-developed" }
Expand Down
8 changes: 4 additions & 4 deletions unic/idna/mapping/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-idna-mapping"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand All @@ -13,9 +13,9 @@ categories = ["internationalization", "text-processing", "parsing", "rendering"]
exclude = []

[dependencies]
unic-char-range = { path = "../../char/range/", version = "0.8.0" }
unic-char-property = { path = "../../char/property/", version = "0.8.0" }
unic-ucd-version = { path = "../../ucd/version/", version = "0.8.0" }
unic-char-range = { path = "../../char/range/", version = "0.9.0" }
unic-char-property = { path = "../../char/property/", version = "0.9.0" }
unic-ucd-version = { path = "../../ucd/version/", version = "0.9.0" }

[badges]
maintenance = { status = "actively-developed" }
Expand Down
2 changes: 1 addition & 1 deletion unic/idna/punycode/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unic-idna-punycode"
version = "0.8.0"
version = "0.9.0"
edition = "2018"
authors = ["The UNIC Project Developers"]
repository = "https://github.com/open-i18n/rust-unic/"
Expand Down
Loading

0 comments on commit 89f5f55

Please sign in to comment.