diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index c664c1c..2e4f405 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -1,12 +1,20 @@ = Changelog Rizzen Yazston -== i18n 0.6.0 (2023-06-??) +== i18n 0.6.0 (2023-07-0?) WARNING: This update has API breaking changes for some `i18n` crates. Breaking change is the result of changing how ICU data providers are used and passed to various components, thus many examples are affected even if the module is not affected by the ICU data provider change. +* Updated various `Cargo.toml` files: + +** Bumped rust-version to "1.70.0". + +** Bumped all ICU4X crates version to "1.2.0". + +** Bumped rusqlite crate version to "1.29.0". + * Added the `icu` crate: ** Added `IcuDataProvider`, `DataProviderWrapper`, and `IcuError`. @@ -31,6 +39,8 @@ Breaking change is the result of changing how ICU data providers are used and pa ** Made `Lexer` struct private, made both `tokenise()` and `add_previous_characters()` methods as normal functions, removed `try_new` method and added `&Rc` to `tokenise()` function parameters. +** Re-enabled the string segmenter function, as the issue in icu_segmenter 0.8.0 was fixed in icu_segmenter 1.2.0, allowing proper counting of graphemes in a string slice. + ** Removed the `error.rs` as neither of the functions returns errors. ** Updated the `lib.rs` to remove `error` module. diff --git a/crates/i18n/Cargo.toml b/crates/i18n/Cargo.toml index 75abfae..402d649 100644 --- a/crates/i18n/Cargo.toml +++ b/crates/i18n/Cargo.toml @@ -7,7 +7,7 @@ name = "i18n-rizzen-yazston" version = "0.5.0" authors = ["Rizzen Yazston"] edition = "2021" -rust-version = "1.67.0" +rust-version = "1.70.0" description = "The `i18n` crate of the Internationalisation project." license = "BSD-3-Clause" readme = "README.asciidoc" diff --git a/crates/icu/Cargo.toml b/crates/icu/Cargo.toml index 0c705cc..2aa278f 100644 --- a/crates/icu/Cargo.toml +++ b/crates/icu/Cargo.toml @@ -7,7 +7,7 @@ name = "i18n_icu-rizzen-yazston" version = "0.5.0" authors = ["Rizzen Yazston"] edition = "2021" -rust-version = "1.67.0" +rust-version = "1.70.0" description = "The `i18n_icu` crate of the Internationalisation project." license = "BSD-3-Clause" readme = "README.asciidoc" @@ -18,16 +18,16 @@ keywords = ["internationalization", "localization", "icu4x"] categories = ["internationalization", "localization", "rust-pattern"] [dependencies] -icu_provider = "1.1.0" -icu_properties = "1.1.0" -icu_segmenter = "0.8.0" -icu_plurals = "1.1.0" -icu_decimal = "1.1.0" -icu_calendar = "1.1.0" -icu_datetime = "1.1.0" +icu_provider = "1.2.0" +icu_properties = "1.2.0" +icu_segmenter = "1.2.0" +icu_plurals = "1.2.0" +icu_decimal = "1.2.0" +icu_calendar = "1.2.0" +icu_datetime = "1.2.0" [dependencies.fixed_decimal] -version = "0.5.2" +version = "0.5.3" # Needed for floating point support. features = [ "ryu" ] diff --git a/crates/icu/README.asciidoc b/crates/icu/README.asciidoc index 4150a77..3a24900 100644 --- a/crates/icu/README.asciidoc +++ b/crates/icu/README.asciidoc @@ -20,19 +20,19 @@ Stefano Angeleri for advice on various design aspects of implementing the compon ``` [dependencies] -icu_provider = "1.1.0" +icu_provider = "1.2.0" # These are required for the DataProvider. -icu_properties = "1.1.0" -icu_segmenter = "0.8.0" -icu_plurals = "1.1.0" -icu_decimal = "1.1.0" -icu_calendar = "1.1.0" -icu_datetime = "1.1.0" +icu_properties = "1.2.0" +icu_segmenter = "1.2.0" +icu_plurals = "1.2.0" +icu_decimal = "1.2.0" +icu_calendar = "1.2.0" +icu_datetime = "1.2.0" # This is required for the DataProvider. [dependencies.fixed_decimal] -version = "0.5.2" +version = "0.5.3" # Needed for floating point support. features = [ "ryu" ] ``` diff --git a/crates/lexer/Cargo.toml b/crates/lexer/Cargo.toml index b1a2ed0..c8a4bec 100644 --- a/crates/lexer/Cargo.toml +++ b/crates/lexer/Cargo.toml @@ -7,7 +7,7 @@ name = "i18n_lexer-rizzen-yazston" version = "0.5.0" authors = ["Rizzen Yazston"] edition = "2021" -rust-version = "1.67.0" +rust-version = "1.70.0" description = "The `i18n_lexer` crate of the Internationalisation project." license = "BSD-3-Clause" readme = "README.asciidoc" @@ -19,53 +19,53 @@ categories = ["internationalization", "localization", "rust-pattern"] [dependencies] i18n_icu-rizzen-yazston = { version = "0.5.0", path = "../icu" } -icu_provider = "1.1.0" -icu_properties = "1.1.0" -icu_segmenter = "0.8.0" -icu_plurals = "1.1.0" -icu_decimal = "1.1.0" -icu_calendar = "1.1.0" -icu_datetime = "1.1.0" +icu_provider = "1.2.0" +icu_properties = "1.2.0" +icu_segmenter = "1.2.0" +icu_plurals = "1.2.0" +icu_decimal = "1.2.0" +icu_calendar = "1.2.0" +icu_datetime = "1.2.0" [dependencies.fixed_decimal] -version = "0.5.2" +version = "0.5.3" # Required for floating point support features = [ "ryu" ] [dev-dependencies] [dev-dependencies.icu_provider] -version = "1.1.0" +version = "1.2.0" # Needed for BufferProvider features = [ "serde", "deserialize_bincode_1" ] [dev-dependencies.icu_properties] -version = "1.1.0" +version = "1.2.0" # Needed for BufferProvider features = [ "serde" ] [dev-dependencies.icu_segmenter] -version = "0.8.0" +version = "1.2.0" # Needed for BufferProvider features = [ "serde" ] [dev-dependencies.icu_plurals] -version = "1.1.0" +version = "1.2.0" # Needed for BufferProvider features = [ "serde" ] [dev-dependencies.icu_calendar] -version = "1.1.0" +version = "1.2.0" # Needed for BufferProvider features = [ "serde" ] [dev-dependencies.icu_datetime] -version = "1.1.0" +version = "1.2.0" # Needed for BufferProvider features = [ "serde" ] [dev-dependencies.icu_testdata] -version = "1.1.0" +version = "1.2.0" # Needed for BufferProvider and icu_segmenter features = [ "buffer", "icu_segmenter" ] diff --git a/crates/lexer/README.asciidoc b/crates/lexer/README.asciidoc index 60f3adf..ce350e5 100644 --- a/crates/lexer/README.asciidoc +++ b/crates/lexer/README.asciidoc @@ -22,7 +22,21 @@ Stefano Angeleri for advice on various design aspects of implementing the compon ``` [dependencies] i18n_icu-rizzen-yazston = "0.5.0" -icu_provider = "1.1.0" +icu_provider = "1.2.0" + +# These are required for the DataProvider. +icu_properties = "1.2.0" +icu_segmenter = "1.2.0" +icu_plurals = "1.2.0" +icu_decimal = "1.2.0" +icu_calendar = "1.2.0" +icu_datetime = "1.2.0" + +# This is required for the DataProvider. +[dependencies.fixed_decimal] +version = "0.5.3" +# Needed for floating point support. +features = [ "ryu" ] ``` == Examples diff --git a/crates/lexer/src/lexer.rs b/crates/lexer/src/lexer.rs index 6e0550d..823f99c 100644 --- a/crates/lexer/src/lexer.rs +++ b/crates/lexer/src/lexer.rs @@ -142,12 +142,6 @@ pub fn tokenise<'a, let mut iterator = string.as_ref().char_indices(); while let Some( ( position, character ) ) = iterator.next() { lexer.position_byte = position; - -// These are left here until the GraphemeClusterSegmenter works correctly, currently buggy. -//println!( "Byte position: {}", lexer.position_byte ); -//println!( "Character position: {}", lexer.position_character ); -//println!( "Grapheme position: {}", lexer.position_grapheme ); - if lexer.data_provider.pattern_white_space().as_borrowed().contains( character ) { if state == LexerStates::Identifier { add_previous_characters( &mut lexer, &mut tokens, TokenType::Identifier, string.as_ref() ); @@ -279,9 +273,7 @@ P: ?Sized + DataProvider + DataProvider - write!( formatter, "No children nodes was not found for ‘{}’ node.", node_type ), + write!( formatter, "No children nodes was found for ‘{}’ node.", node_type ), FormatterError::InvalidOption( option, keyword, placeholder ) => write!( formatter, diff --git a/crates/provider/core/Cargo.toml b/crates/provider/core/Cargo.toml index 5ca0126..046ea9f 100644 --- a/crates/provider/core/Cargo.toml +++ b/crates/provider/core/Cargo.toml @@ -7,7 +7,7 @@ name = "i18n_provider-rizzen-yazston" version = "0.5.0" authors = ["Rizzen Yazston"] edition = "2021" -rust-version = "1.67.0" +rust-version = "1.70.0" description = "The `i18n_provider` crate of the Internationalisation project." license = "BSD-3-Clause" readme = "README.asciidoc" diff --git a/crates/provider/sqlite3/Cargo.toml b/crates/provider/sqlite3/Cargo.toml index 772984b..ff2f500 100644 --- a/crates/provider/sqlite3/Cargo.toml +++ b/crates/provider/sqlite3/Cargo.toml @@ -7,7 +7,7 @@ name = "i18n_provider_sqlite3-rizzen-yazston" version = "0.5.0" authors = ["Rizzen Yazston"] edition = "2021" -rust-version = "1.67.0" +rust-version = "1.70.0" description = "The `i18n_provider_sqlite3` crate of the Internationalisation project." license = "BSD-3-Clause" readme = "README.asciidoc" @@ -18,10 +18,10 @@ keywords = ["internationalization", "localization", "icu4x"] categories = ["internationalization", "localization", "rust-pattern"] [dependencies] -icu_locid = "1.1.0" i18n_utility-rizzen-yazston = { version = "0.5.0", path = "../../utility" } i18n_provider-rizzen-yazston = { version = "0.5.0", path = "../core" } -rusqlite = "0.28.0" +icu_locid = "1.2.0" +rusqlite = "0.29.0" [dev-dependencies] diff --git a/crates/provider/sqlite3/i18n/i18n_provider_sqlite3.sqlite3 b/crates/provider/sqlite3/i18n/i18n_provider_sqlite3.sqlite3 index 7f61fc4..17abdf3 100644 Binary files a/crates/provider/sqlite3/i18n/i18n_provider_sqlite3.sqlite3 and b/crates/provider/sqlite3/i18n/i18n_provider_sqlite3.sqlite3 differ diff --git a/crates/utility/Cargo.toml b/crates/utility/Cargo.toml index 25581fc..2ea052f 100644 --- a/crates/utility/Cargo.toml +++ b/crates/utility/Cargo.toml @@ -7,7 +7,7 @@ name = "i18n_utility-rizzen-yazston" version = "0.5.0" authors = ["Rizzen Yazston"] edition = "2021" -rust-version = "1.67.0" +rust-version = "1.70.0" description = "The `i18n_utility` crate of the Internationalisation project." license = "BSD-3-Clause" readme = "README.asciidoc" @@ -18,7 +18,7 @@ keywords = ["internationalization", "localization", "icu4x"] categories = ["internationalization", "localization", "rust-pattern"] [dependencies] -icu_locid = "1.1.0" +icu_locid = "1.2.0" [lib] name = "i18n_utility" diff --git a/crates/utility/README.asciidoc b/crates/utility/README.asciidoc index 077c58a..4f86c02 100644 --- a/crates/utility/README.asciidoc +++ b/crates/utility/README.asciidoc @@ -44,7 +44,7 @@ Simply include the `i18n_utility-rizzen-yazston` crate in the `Cargo.toml` to ma ``` [dependencies] -icu_locid = "1.1.0" +icu_locid = "1.2.0" i18n_utility-rizzen-yazston = "0.5.0" ```