From edfd5c9aa70c14afad7416102d6d14a2733ed972 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 30 Aug 2023 09:48:40 -0700 Subject: [PATCH] Use Unicode 15 tables for unicode normalization and segmentation To match with the Unicode support in Go 1.21, we'll now use the Unicode 15 tables when we're normalizing Unicode strings and when counting user-perceived characters ("grapheme clusters") for source position purposes. --- go.mod | 7 ++++--- go.sum | 10 ++++++---- hclsyntax/parser.go | 2 +- hclsyntax/parser_template.go | 2 +- hclsyntax/token.go | 2 +- hclwrite/tokens.go | 2 +- json/scanner.go | 2 +- pos_scanner.go | 2 +- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 0f44c307..4c0c18c7 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/agext/levenshtein v1.2.1 github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 - github.com/apparentlymart/go-textseg/v13 v13.0.0 + github.com/apparentlymart/go-textseg/v15 v15.0.0 github.com/davecgh/go-spew v1.1.1 github.com/go-test/deep v1.0.3 github.com/google/go-cmp v0.3.1 @@ -20,10 +20,11 @@ require ( ) require ( + github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/kr/text v0.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.2.2 // indirect - golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect + golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect - golang.org/x/text v0.3.8 // indirect + golang.org/x/text v0.11.0 // indirect ) diff --git a/go.sum b/go.sum index b9544a42..a7ce4583 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,8 @@ github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:o github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= @@ -40,12 +42,12 @@ golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/hclsyntax/parser.go b/hclsyntax/parser.go index 6ed88e63..aa147afe 100644 --- a/hclsyntax/parser.go +++ b/hclsyntax/parser.go @@ -9,7 +9,7 @@ import ( "strconv" "unicode/utf8" - "github.com/apparentlymart/go-textseg/v13/textseg" + "github.com/apparentlymart/go-textseg/v15/textseg" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hclsyntax/parser_template.go b/hclsyntax/parser_template.go index 3ac68298..19e98806 100644 --- a/hclsyntax/parser_template.go +++ b/hclsyntax/parser_template.go @@ -8,7 +8,7 @@ import ( "strings" "unicode" - "github.com/apparentlymart/go-textseg/v13/textseg" + "github.com/apparentlymart/go-textseg/v15/textseg" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/hclsyntax/token.go b/hclsyntax/token.go index a14b3940..afde5f33 100644 --- a/hclsyntax/token.go +++ b/hclsyntax/token.go @@ -7,7 +7,7 @@ import ( "bytes" "fmt" - "github.com/apparentlymart/go-textseg/v13/textseg" + "github.com/apparentlymart/go-textseg/v15/textseg" "github.com/hashicorp/hcl/v2" ) diff --git a/hclwrite/tokens.go b/hclwrite/tokens.go index 909bb4bb..7b6fddce 100644 --- a/hclwrite/tokens.go +++ b/hclwrite/tokens.go @@ -7,7 +7,7 @@ import ( "bytes" "io" - "github.com/apparentlymart/go-textseg/v13/textseg" + "github.com/apparentlymart/go-textseg/v15/textseg" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" ) diff --git a/json/scanner.go b/json/scanner.go index d15c1a33..cae84859 100644 --- a/json/scanner.go +++ b/json/scanner.go @@ -6,7 +6,7 @@ package json import ( "fmt" - "github.com/apparentlymart/go-textseg/v13/textseg" + "github.com/apparentlymart/go-textseg/v15/textseg" "github.com/hashicorp/hcl/v2" ) diff --git a/pos_scanner.go b/pos_scanner.go index cff55392..2232f374 100644 --- a/pos_scanner.go +++ b/pos_scanner.go @@ -7,7 +7,7 @@ import ( "bufio" "bytes" - "github.com/apparentlymart/go-textseg/v13/textseg" + "github.com/apparentlymart/go-textseg/v15/textseg" ) // RangeScanner is a helper that will scan over a buffer using a bufio.SplitFunc