Граф коммитов

35 Коммитов

Автор SHA1 Сообщение Дата
Dmitri Shuralyov 6c97a165dd all: update go directive to 1.18
Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

Also update code generators to use only the new go:build lines,
not the old +build ones.

For golang/go#60268.

Change-Id: I832981d939ab0aad5c941555a6a4cd005958a189
Reviewed-on: https://go-review.googlesource.com/c/text/+/534242
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2023-10-11 21:58:48 +00:00
cui fliter 795e854ff3 all: replace io/ioutil with io and os package
For golang/go#45557

Change-Id: Ibf78d87cc94baa0d1696e5abc2edad3d2723e42b
GitHub-Last-Rev: ad314caaff
GitHub-Pull-Request: golang/text#34
Reviewed-on: https://go-review.googlesource.com/c/text/+/430815
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-09-19 15:59:07 +00:00
Damien Neil 8da7c0fd2b gen.go: copy all tablesXX.X.X.go versions to golang.org/x/net
Remove logic that copies only the most current tablesXX.X.X.go,
renaming it to tables.go. The golang.org/x/net/idna package
currently contains all the versioned files and no tables.go,
so this change makes gen.go consistent with the last export.

Change-Id: Ic2797b45ec998873651eda04ed56ada29788f0f0
Reviewed-on: https://go-review.googlesource.com/c/text/+/360380
Trust: Damien Neil <dneil@google.com>
Trust: Marcel van Lohuizen <mpvl@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2021-11-02 16:52:14 +00:00
Russ Cox 8f690f22cf all: go fmt ./...
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Not strictly necessary but will avoid spurious changes
as files are edited.

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: I8f1f65728dad29d63bc5a1ea5fdb4cbac255c7e5
Reviewed-on: https://go-review.googlesource.com/c/text/+/294372
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-02-20 03:31:29 +00:00
Marcel van Lohuizen 22f1617af3 language: update from IANA language-subtag-registry
Also adds a dependency in the main gen.go file to include
this automatically in the generation process.

Change-Id: I395b686eec4dacd3639de0e78a48dfe3fdb0d6ce
Reviewed-on: https://go-review.googlesource.com/c/text/+/262217
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Marcel van Lohuizen <mpvl@golang.org>
2020-10-21 14:53:29 +00:00
Marcel van Lohuizen b1379a7b47 gen.go: update due to changes to core
Updates documentation and other changes not related to
a Unicode upgrade to minimize the diff.

This CL also updates gen.go to no longer copy packages
into the vendor directory. Henceforth, go mod vendor
should be used to copy packages.

Updates golang/go#27945

Change-Id: I59da1c56e81bec67979ce13d89af3a753d4809aa
Reviewed-on: https://go-review.googlesource.com/c/text/+/169637
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2019-04-24 15:10:08 +00:00
Marcel van Lohuizen fe223c5a25 gen: prepare for move to Unicode 11
automatically update build tags
option to skip tests

Change-Id: Ic1e40c1a8308ed3641ba219a6e55b76dee98581f
Reviewed-on: https://go-review.googlesource.com/c/text/+/154440
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-21 11:57:27 +00:00
Marcel van Lohuizen 6c92c7dc7f internal/export/unicode: add table generator
This is used to update tables in core unicode.

Change-Id: I6fb34eba45842e38426b1ca54e79b74c361195ec
Reviewed-on: https://go-review.googlesource.com/c/154439
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-02-13 13:55:15 +00:00
Marcel van Lohuizen 7319793cff gen.go: fix breakage due to changes in core
Changes:
src/vendor/golang_org moved to src/internal/x

Change-Id: I3791fd633534f15f5e2698ad01ae8d226128181e
Reviewed-on: https://go-review.googlesource.com/c/154438
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ross Light <light@google.com>
2019-02-13 13:49:04 +00:00
Igor Zhilianin 6f8607282f all: fix typos
Change-Id: I75fed8f43aa08a780adf0027d86abebf710e9716
GitHub-Last-Rev: 9e3fe59214
GitHub-Pull-Request: golang/text#4
Reviewed-on: https://go-review.googlesource.com/c/145358
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2018-10-29 11:54:30 +00:00
Marcel van Lohuizen ab48842968 internal: use Parent from compact and remove internal’s
This has the side-effect that the implementations using
compact tags will now have to chose whether to use
the regional or language variant of the tag. For instance,
the number package may display Swiss German number
formatting, even though the language selected is German.

Note that the tables for plural rules have slightly changed.
The new changes pick up data for some deprecated tags as
well. The entries for the deprecated tags could be removed
as compact indices, but as long as they are there, the
changes introduced here are correct. In practice the
language Matcher will match deprecated tags to their
modern equivalent, so these changes will have no effect
in practice.

Change-Id: I32f9149b0748a3ce51cab332b43a74092deffd8f
Reviewed-on: https://go-review.googlesource.com/98438
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ross Light <light@google.com>
2018-03-23 13:56:13 +00:00
Marcel van Lohuizen ffa9e5ed68 unicode/runenames: support for multiple unicode versions
Also rewrote the representation, which did not work for
Unicode 10

Change-Id: I39d9907908c67d07f8bbc153942ab0d8ab02ab6e
Reviewed-on: https://go-review.googlesource.com/96736
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ross Light <light@google.com>
2018-03-01 21:44:40 +00:00
Marcel van Lohuizen 27420a1a39 internal/language: move package to internal
Change-Id: I6fff414e66cb08c5f09cba14c936319335b63dde
Reviewed-on: https://go-review.googlesource.com/95833
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 19:36:32 +00:00
Marcel van Lohuizen 7c3f0bbfa3 language: new implementation of compact tags
Also updated date tables for this change and fixed
a small bug in code.go, which would escape '\', but
allowe it ('\\') to be broken across lines.

Change-Id: I139bf149a703f1063ccf10a8bae695be5696d97d
Reviewed-on: https://go-review.googlesource.com/95827
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 18:49:11 +00:00
Marcel van Lohuizen d5f0155fc1 internal/cldrtree: included in gen.go
Change-Id: I149d44933ef36e48961e4d405267f578950ba7ac
Reviewed-on: https://go-review.googlesource.com/82906
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-14 13:06:06 +00:00
Marcel van Lohuizen 6097f7ad59 gen.go: fix dependencies to fix CLDR 32 generation
Change-Id: I5dcfcc2c7cbbd5c3415d1c98a7a3a216725f575d
Reviewed-on: https://go-review.googlesource.com/82901
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-14 13:01:39 +00:00
Marcel van Lohuizen ab5ac5f9a8 gen.go: some improvements
- Update api files in core when updating
  Unicode version
- Exclude examples from copied packages.

Change-Id: Id96e735fb8acdd57d3fa0bc6eb01eaa817c1d421
Reviewed-on: https://go-review.googlesource.com/63610
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-09-14 09:07:07 +00:00
Marcel van Lohuizen 996754b7a9 gen.go: support Unicode 10.0.0 version string
Correct ordering for upcoming
Unicode 10 string.

Change-Id: Id239f02f8c5b7cfa64fa9e9ce649a192350e0b39
Reviewed-on: https://go-review.googlesource.com/63173
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-09-14 09:05:42 +00:00
Marcel van Lohuizen 3232afbc64 feature/plural: move and regenerate remaining code
Move parts of code and do some renaming.

Manually change go generate directives and added new package to
x/text/gen.go

Regenerate tables for original and destination package.

Change-Id: I728dde1c0f7dcc289372fb815ecc4ed85d182cc2
Reviewed-on: https://go-review.googlesource.com/39132
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-04-20 07:17:47 +00:00
Marcel van Lohuizen fc7fa09741 internal/gen: use new DO NOT EDIT comment standard.
See proposal golang/go#13560.

Also updated gen.go to include all packages using internal/gen
and to update the “Copy” comment.

Change-Id: Iad084642af3700a112b4305aef0c55b475893106
Reviewed-on: https://go-review.googlesource.com/38368
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-23 19:41:35 +00:00
Marcel van Lohuizen f262f46363 : export examples, even if not tests in general
Change-Id: Idb1ec5f8d9688779a2351afe6a0e7e2af3a2bb84
Reviewed-on: https://go-review.googlesource.com/36872
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-02-15 09:20:36 +00:00
Marcel van Lohuizen 44f4f658a7 text: copy exported packages to destination repo
Also rewrote vendoring update code to use the same code.
This way vendored packages don’t have to be manually
updated if there are new files to be added.

Change-Id: Ifcb48148cbe7badbc1a37eadf96ec4b975028f83
Reviewed-on: https://go-review.googlesource.com/34649
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-01-05 19:38:44 +00:00
Marcel van Lohuizen c745997bb1 : upgrade to CLDR 30
The trickiest changes are in language/display where the dropping
of nl-BE as Vlaams in Dutch caused some issues. This will
probably be changed back as I think this change is erroneous, but
as we’re not into the politics of it, we adopt the CLDR changes.

Change-Id: I6c593960778cd4c5b9f0553340b72a1410166506
Reviewed-on: https://go-review.googlesource.com/30910
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-10-13 08:00:25 +00:00
Marcel van Lohuizen 098f51fb68 gen.go: include core unicode generation
Include the generation of core Unicode tables in generation process.

Also ensure that vendored packages are up to date after the update.

Using this tool to update Core ensures that core, at least, will use a
consistent set of Unicode.

Change-Id: Ic7cca370b4af8556a79111f1b5ec2eb4381b5dc1
Reviewed-on: https://go-review.googlesource.com/29990
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-03 12:50:28 +00:00
Marcel van Lohuizen 6bd68a1ace gen.go: fixed bug in version printing
Change-Id: I25e3d7407a037494774810cf0e50741229affae3
Reviewed-on: https://go-review.googlesource.com/24497
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
2016-07-01 14:36:55 +00:00
Marcel van Lohuizen 09761194ac : added new packages to gen tool
secure/precis and internal/number were added.

Also update dependencies included in tests (running tests was recently added, but not all dependencies).

bidi is added to precis preemptively.

Change-Id: Ie27ed195e7475691afb7f80dd390ef4279cce6d5
Reviewed-on: https://go-review.googlesource.com/19351
Reviewed-by: Sam Whited <sam@samwhited.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-02-11 11:41:52 +00:00
Marcel van Lohuizen eab9e05b70 : run long tests after a generated package
To build the repo one should typically use the UNICODE_DIR env var to
allow reasonable build times.

This change standardizes the long option from tests and causes long
tests to run if the UNICODE_DIR env var is set. It thereby ensures
that these tests are run when the repo is built.

Change-Id: I26f5656069146d4966d773eafd0a2e4797f18f22
Reviewed-on: https://go-review.googlesource.com/17963
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-12-17 20:58:02 +00:00
Marcel van Lohuizen ecbd6a8c83 : added bidi and htmlindex packages to gen.go
The htmlindex is a bit out of place, but this at least ensures that
it is periodically checked.

Change-Id: I53c5dafbdd8f8a6cfbd50bdd6d4f12d5a6bf9a83
Reviewed-on: https://go-review.googlesource.com/17803
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-12-14 18:16:05 +00:00
Marcel van Lohuizen edeeb43dc4 unicode/cldr: moved cldr to the unicode directory
The cldr package is quite low-level and probably would only for
internal use if it hadn't predated the internal directory convention.

Added doc.go in unicode directory to clarify nature of packages in
this subdirectory.

After this, the package that remains to be moved to unicode is bidi.

Change-Id: Ibff3285ca8cc00980e48fd30754c3f7abc87b2a0
Reviewed-on: https://go-review.googlesource.com/17491
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-12-06 18:04:42 +00:00
Marcel van Lohuizen b8e57db2c3 language/display: moved display package
The display package is now limited to contain only names for values
related to the language package. Moving it as a subpackage of
language makes both its purpose and discoverability clearer.

Sorry for the inconveniences.

Change-Id: I5321e7b81f0837f25f2523f6eb4811f82d0455b8
Reviewed-on: https://go-review.googlesource.com/17490
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-12-06 18:03:54 +00:00
Marcel van Lohuizen 8f6601ec02 : Added depdendencies to top-level generator.
Added internal and currency's dependency upon it (upcoming).

Change-Id: I8d5f64f5ff1fc975867ca2c64a2d9d365242d773
Reviewed-on: https://go-review.googlesource.com/14804
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-22 06:38:05 +00:00
Marcel van Lohuizen 6368131e2e currency: refactored currency-related code.
Moved currency-related code from language to a separate package.
This will fit better in the grand design for localization support.

Also exposed rounding modes in new API.

Change-Id: Iad8e0988241b81312c4c4458db0ee5f16c71f6a9
Reviewed-on: https://go-review.googlesource.com/13855
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-09 08:27:44 +00:00
Marcel van Lohuizen 8553a646c4 : added search and added missing dependency.
Change-Id: Idba094792a540c1cf2c2e47bc3f2353c12424f8d
Reviewed-on: https://go-review.googlesource.com/11994
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-07-13 14:02:06 +00:00
Marcel van Lohuizen 1609407601 unicode/rangetable: added New and Visit
I find myself wanting these utilities in testing code and they
seem to be generally useful enough to make public.

Change-Id: I4afd7cfc99bc797c5c12fe12bad40f0f16ed3400
Reviewed-on: https://go-review.googlesource.com/11493
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-06-30 08:34:46 +00:00
Marcel van Lohuizen b6e95e7b86 text: added repository-wide generate tool.
This helps the repo maintainer upgrading packages to new versions
and also serves as documentation on dependencies.

@r: it would be convenient to also generate the core unicode tables
using this tool. It would be handy to slightly streamline the flags
of the unicode package for this. I can do this if changing some of
the semantics of the flags is acceptable.

Change-Id: Ib67161f7fe8724007d3c1479d5d173af65f646c7
Reviewed-on: https://go-review.googlesource.com/7495
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-20 06:39:55 +00:00