From 76669ad14de1d2066b564edffd2f82e6c6202f08 Mon Sep 17 00:00:00 2001 From: pagedown Date: Fri, 18 Nov 2022 13:01:32 +0800 Subject: [PATCH] Note the Unicode version in the generated files Files generated from the same Unicode version will be consistent regardless of the date they were built. --- gen-wcwidth.py | 4 ++-- kittens/unicode_input/names.h | 5 +++-- kitty/emoji.h | 5 +++-- kitty/unicode-data.c | 5 +++-- kitty/wcwidth-std.h | 5 +++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gen-wcwidth.py b/gen-wcwidth.py index 9fafc712c..12c246cb1 100755 --- a/gen-wcwidth.py +++ b/gen-wcwidth.py @@ -278,8 +278,8 @@ def write_case(spec: Union[Tuple[int, ...], int], p: Callable[..., None], for_go def create_header(path: str, include_data_types: bool = True) -> Generator[Callable[..., None], None, None]: with open(path, 'w') as f: p = partial(print, file=f) - p('// unicode data, built from the unicode standard on:', date.today()) - p('// see gen-wcwidth.py') + p('// Unicode data, built from the Unicode Standard', '.'.join(map(str, unicode_version()))) + p(f'// Code generated by {os.path.basename(__file__)}, DO NOT EDIT.', end='\n\n') if path.endswith('.h'): p('#pragma once') if include_data_types: diff --git a/kittens/unicode_input/names.h b/kittens/unicode_input/names.h index c406c1f12..d7c92ed0a 100644 --- a/kittens/unicode_input/names.h +++ b/kittens/unicode_input/names.h @@ -1,5 +1,6 @@ -// unicode data, built from the unicode standard on: 2022-11-17 -// see gen-wcwidth.py +// Unicode data, built from the Unicode Standard 15.0.0 +// Code generated by gen-wcwidth.py, DO NOT EDIT. + #pragma once #include "data-types.h" diff --git a/kitty/emoji.h b/kitty/emoji.h index 8144ef494..665eea98d 100644 --- a/kitty/emoji.h +++ b/kitty/emoji.h @@ -1,5 +1,6 @@ -// unicode data, built from the unicode standard on: 2022-11-17 -// see gen-wcwidth.py +// Unicode data, built from the Unicode Standard 15.0.0 +// Code generated by gen-wcwidth.py, DO NOT EDIT. + #pragma once #include "data-types.h" diff --git a/kitty/unicode-data.c b/kitty/unicode-data.c index dbc0db707..4ab7a0f90 100644 --- a/kitty/unicode-data.c +++ b/kitty/unicode-data.c @@ -1,5 +1,6 @@ -// unicode data, built from the unicode standard on: 2022-11-17 -// see gen-wcwidth.py +// Unicode data, built from the Unicode Standard 15.0.0 +// Code generated by gen-wcwidth.py, DO NOT EDIT. + #include "data-types.h" START_ALLOW_CASE_RANGE diff --git a/kitty/wcwidth-std.h b/kitty/wcwidth-std.h index 958706ccf..b14e89b35 100644 --- a/kitty/wcwidth-std.h +++ b/kitty/wcwidth-std.h @@ -1,5 +1,6 @@ -// unicode data, built from the unicode standard on: 2022-11-17 -// see gen-wcwidth.py +// Unicode data, built from the Unicode Standard 15.0.0 +// Code generated by gen-wcwidth.py, DO NOT EDIT. + #pragma once #include "data-types.h"