From c162dc5f272cace753e5465054e882e25606392b Mon Sep 17 00:00:00 2001 From: Ryan Lopopolo Date: Fri, 21 Aug 2020 17:46:29 -0700 Subject: [PATCH 1/4] Add comments to generated sourcefiles indicating they are generated Also note the time the sources were last generated. --- scripts/gen_case_lookups.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/gen_case_lookups.rb b/scripts/gen_case_lookups.rb index 0f3bf79c..455c6d46 100755 --- a/scripts/gen_case_lookups.rb +++ b/scripts/gen_case_lookups.rb @@ -60,6 +60,11 @@ rs = File.open('src/folding/mapping/lookup.rs', 'w') rs.puts(<<~AUTOGEN) + // This source is autogenerated. Do not modify it directly. + // To make modfications to this code, see `scripts/gen_case_lookups.rb`. + // + // Last generated on #{Time.now.utc}. + use super::{Mapping, Mode}; #[must_use] @@ -181,6 +186,11 @@ rs = File.open('tests/full_fold_exhaustive.rs', 'w') rs.puts(<<~AUTOGEN) + // This source is autogenerated. Do not modify it directly. + // To make modfications to this code, see `scripts/gen_case_lookups.rb`. + // + // Last generated on #{Time.now.utc}. + use core::char; use core::cmp::Ordering; use focaccia::{unicode_full_case_eq, unicode_full_casecmp}; @@ -258,6 +268,11 @@ rs = File.open('tests/full_turkic_fold_exhaustive.rs', 'w') rs.puts(<<~AUTOGEN) + // This source is autogenerated. Do not modify it directly. + // To make modfications to this code, see `scripts/gen_case_lookups.rb`. + // + // Last generated on #{Time.now.utc}. + use core::char; use core::cmp::Ordering; use focaccia::{unicode_full_turkic_case_eq, unicode_full_turkic_casecmp}; From 5c2908b21b025a71137f51329294e9bd301cfdc9 Mon Sep 17 00:00:00 2001 From: Ryan Lopopolo Date: Fri, 21 Aug 2020 17:46:52 -0700 Subject: [PATCH 2/4] rake unicode:build --- src/folding/mapping/lookup.rs | 5 +++++ tests/full_fold_exhaustive.rs | 5 +++++ tests/full_turkic_fold_exhaustive.rs | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/folding/mapping/lookup.rs b/src/folding/mapping/lookup.rs index 70417b94..648c20fd 100644 --- a/src/folding/mapping/lookup.rs +++ b/src/folding/mapping/lookup.rs @@ -1,3 +1,8 @@ +// This source is autogenerated. Do not modify it directly. +// To make modfications to this code, see `scripts/gen_case_lookups.rb`. +// +// Last generated on 2020-08-22 00:44:58 UTC. + use super::{Mapping, Mode}; #[must_use] diff --git a/tests/full_fold_exhaustive.rs b/tests/full_fold_exhaustive.rs index 61f4761b..144191ca 100644 --- a/tests/full_fold_exhaustive.rs +++ b/tests/full_fold_exhaustive.rs @@ -1,3 +1,8 @@ +// This source is autogenerated. Do not modify it directly. +// To make modfications to this code, see `scripts/gen_case_lookups.rb`. +// +// Last generated on 2020-08-22 00:44:58 UTC. + use core::char; use core::cmp::Ordering; use focaccia::{unicode_full_case_eq, unicode_full_casecmp}; diff --git a/tests/full_turkic_fold_exhaustive.rs b/tests/full_turkic_fold_exhaustive.rs index f4cfdb67..59145f3d 100644 --- a/tests/full_turkic_fold_exhaustive.rs +++ b/tests/full_turkic_fold_exhaustive.rs @@ -1,3 +1,8 @@ +// This source is autogenerated. Do not modify it directly. +// To make modfications to this code, see `scripts/gen_case_lookups.rb`. +// +// Last generated on 2020-08-22 00:44:58 UTC. + use core::char; use core::cmp::Ordering; use focaccia::{unicode_full_turkic_case_eq, unicode_full_turkic_casecmp}; From 9ce60d1cf5fabbe825227767ca9df9ce203c09a7 Mon Sep 17 00:00:00 2001 From: Ryan Lopopolo Date: Fri, 21 Aug 2020 17:53:42 -0700 Subject: [PATCH 3/4] Embed Unicode version and copyright into generated sources --- scripts/gen_case_lookups.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/gen_case_lookups.rb b/scripts/gen_case_lookups.rb index 455c6d46..a8567ca5 100755 --- a/scripts/gen_case_lookups.rb +++ b/scripts/gen_case_lookups.rb @@ -3,6 +3,8 @@ mappings = File.readlines('CaseFolding.txt') +casefolding_version = mappings[0..2].map { |line| "// #{line.delete_prefix('# ')}" }.join.chomp + char_mappings = Hash.new { |hash, key| hash[key] = {} } mappings.each do |line| @@ -64,6 +66,9 @@ // To make modfications to this code, see `scripts/gen_case_lookups.rb`. // // Last generated on #{Time.now.utc}. + // + // Unicode version: + #{casefolding_version} use super::{Mapping, Mode}; @@ -190,6 +195,9 @@ // To make modfications to this code, see `scripts/gen_case_lookups.rb`. // // Last generated on #{Time.now.utc}. + // + // Unicode version: + #{casefolding_version} use core::char; use core::cmp::Ordering; @@ -272,6 +280,9 @@ // To make modfications to this code, see `scripts/gen_case_lookups.rb`. // // Last generated on #{Time.now.utc}. + // + // Unicode version: + #{casefolding_version} use core::char; use core::cmp::Ordering; From 6627381921527941b21771d69b3442daed25fd4b Mon Sep 17 00:00:00 2001 From: Ryan Lopopolo Date: Fri, 21 Aug 2020 17:54:01 -0700 Subject: [PATCH 4/4] rake unicode:build --- src/folding/mapping/lookup.rs | 7 ++++++- tests/full_fold_exhaustive.rs | 7 ++++++- tests/full_turkic_fold_exhaustive.rs | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/folding/mapping/lookup.rs b/src/folding/mapping/lookup.rs index 648c20fd..baa53da0 100644 --- a/src/folding/mapping/lookup.rs +++ b/src/folding/mapping/lookup.rs @@ -1,7 +1,12 @@ // This source is autogenerated. Do not modify it directly. // To make modfications to this code, see `scripts/gen_case_lookups.rb`. // -// Last generated on 2020-08-22 00:44:58 UTC. +// Last generated on 2020-08-22 00:52:59 UTC. +// +// Unicode version: +// CaseFolding-13.0.0.txt +// Date: 2019-09-08, 23:30:59 GMT +// © 2019 Unicode®, Inc. use super::{Mapping, Mode}; diff --git a/tests/full_fold_exhaustive.rs b/tests/full_fold_exhaustive.rs index 144191ca..59d9082f 100644 --- a/tests/full_fold_exhaustive.rs +++ b/tests/full_fold_exhaustive.rs @@ -1,7 +1,12 @@ // This source is autogenerated. Do not modify it directly. // To make modfications to this code, see `scripts/gen_case_lookups.rb`. // -// Last generated on 2020-08-22 00:44:58 UTC. +// Last generated on 2020-08-22 00:52:59 UTC. +// +// Unicode version: +// CaseFolding-13.0.0.txt +// Date: 2019-09-08, 23:30:59 GMT +// © 2019 Unicode®, Inc. use core::char; use core::cmp::Ordering; diff --git a/tests/full_turkic_fold_exhaustive.rs b/tests/full_turkic_fold_exhaustive.rs index 59145f3d..0b0dd293 100644 --- a/tests/full_turkic_fold_exhaustive.rs +++ b/tests/full_turkic_fold_exhaustive.rs @@ -1,7 +1,12 @@ // This source is autogenerated. Do not modify it directly. // To make modfications to this code, see `scripts/gen_case_lookups.rb`. // -// Last generated on 2020-08-22 00:44:58 UTC. +// Last generated on 2020-08-22 00:52:59 UTC. +// +// Unicode version: +// CaseFolding-13.0.0.txt +// Date: 2019-09-08, 23:30:59 GMT +// © 2019 Unicode®, Inc. use core::char; use core::cmp::Ordering;