vendor: golang.org/x/text v0.42.0

full diff: https://github.com/golang/text/compare/v0.41.0...v0.42.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-09-14 17:29:43 +02:00
parent ed4de7d484
commit f90c2894a8
10 changed files with 1957 additions and 1942 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ require (
golang.org/x/sync v0.23.0
golang.org/x/sys v0.48.0
golang.org/x/term v0.45.0
golang.org/x/text v0.41.0
golang.org/x/text v0.42.0
gotest.tools/v3 v3.5.2
tags.cncf.io/container-device-interface v1.1.1
)
+2 -2
View File
@@ -211,8 +211,8 @@ golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI=
golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E=
golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE=
golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+2 -3
View File
@@ -6,7 +6,6 @@ package bidi
import (
"fmt"
"log"
)
// This implementation is a port based on the reference implementation found at:
@@ -248,7 +247,7 @@ func (p *paragraph) determineParagraphEmbeddingLevel(start, end int) level {
} else if t.in(FSI, LRI, RLI) {
i = p.matchingPDI[i] // skip over to the matching PDI
if i > end {
log.Panic("assert (i <= end)")
panic("assert (i <= end)")
}
}
}
@@ -729,7 +728,7 @@ loop:
continue loop
}
}
log.Panicf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i])
panic(fmt.Errorf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i]))
}
}
+27 -15
View File
@@ -449,6 +449,16 @@ func (rb *reorderBuffer) combineHangul(s, i, k int) {
// ACxx plus 11Ax to LVT
rb.assignRune(s, l+v-jamoTBase)
default:
// Not a Hangul composition. The segment may still
// contain regular canonical compositions, such as
// combining marks following a Hangul syllable, so
// fall back to the composition table.
if b[i].combinesBackward() {
if combined := combine(l, v); combined != 0 {
rb.assignRune(s, combined)
continue
}
}
b[k] = b[i]
k++
}
@@ -484,25 +494,27 @@ func (rb *reorderBuffer) compose() {
return
}
ii := b[i]
// Track the last starter unconditionally: b[i] must be blocked by
// any starter between it and s, even one that b[i] itself cannot
// combine with, and even if the runes in between never enter the
// combinesBackward branch below.
cccB := b[k-1].ccc
cccC := ii.ccc
blocked := false // b[i] blocked by starter or greater or equal CCC?
if cccB == 0 {
s = k - 1
} else {
blocked = s != k-1 && cccB >= cccC
}
// We can only use combineForward as a filter if we later
// get the info for the combined character. This is more
// expensive than using the filter. Using combinesBackward()
// is safe.
if ii.combinesBackward() {
cccB := b[k-1].ccc
cccC := ii.ccc
blocked := false // b[i] blocked by starter or greater or equal CCC?
if cccB == 0 {
s = k - 1
} else {
blocked = s != k-1 && cccB >= cccC
}
if !blocked {
combined := combine(rb.runeAt(s), rb.runeAt(i))
if combined != 0 {
rb.assignRune(s, combined)
continue
}
if ii.combinesBackward() && !blocked {
combined := combine(rb.runeAt(s), rb.runeAt(i))
if combined != 0 {
rb.assignRune(s, combined)
continue
}
}
b[k] = b[i]
+12 -12
View File
@@ -191,30 +191,30 @@ func (p Properties) TrailCCC() uint8 {
return ccc[p.tccc]
}
// Recomposition
// Each entry of recompMapPacked holds the two runes of the key and the
// composed rune of the value packed into a big-endian uint64 as three
// 21-bit fields, which is wide enough for any rune.
// Note that the recomposition map for NFC and NFKC are identical.
const recompShift = 21
func buildRecompMap() {
recompMap = make(map[uint32]rune, len(recompMapPacked)/8)
recompMap = make(map[uint64]rune, len(recompMapPacked)/8)
var buf [8]byte
for i := 0; i < len(recompMapPacked); i += 8 {
copy(buf[:], recompMapPacked[i:i+8])
key := binary.BigEndian.Uint32(buf[:4])
val := binary.BigEndian.Uint32(buf[4:])
recompMap[key] = rune(val)
e := binary.BigEndian.Uint64(buf[:])
recompMap[e>>recompShift] = rune(e & (1<<recompShift - 1))
}
}
// Recomposition
// We use 32-bit keys instead of 64-bit for the two codepoint keys.
// This clips off the bits of three entries, but we know this will not
// result in a collision. In the unlikely event that changes to
// UnicodeData.txt introduce collisions, the compiler will catch it.
// Note that the recomposition map for NFC and NFKC are identical.
// combine returns the combined rune or 0 if it doesn't exist.
//
// The caller is responsible for calling
// recompMapOnce.Do(buildRecompMap) sometime before this is called.
func combine(a, b rune) rune {
key := uint32(uint16(a))<<16 + uint32(uint16(b))
key := uint64(a)<<recompShift | uint64(b)
if recompMap == nil {
panic("caller error") // see func comment
}
+4 -1
View File
@@ -505,7 +505,10 @@ func decomposeSegment(rb *reorderBuffer, sp int, atEOF bool) int {
// Force one character to be consumed.
info := rb.f.info(rb.src, sp)
if info.isInvalid() {
return 0
// Consume the invalid character.
// Perhaps this should return iShortSrc instead?
// May not matter, this path does not appear to be reachable in practice.
return sp + 1
}
if s := rb.ss.next(info); s == ssStarter {
// TODO: this could be removed if we don't support merging.
+942 -942
View File
File diff suppressed because it is too large Load Diff
+962 -962
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -33,7 +33,7 @@ func (f Form) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)
return nDst + n, nSrc + n, err
}
if err == nil && n < len(src) && !atEOF {
if err == nil && n < len(src) {
err = transform.ErrShortSrc
}
return n, n, err
@@ -67,6 +67,7 @@ func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)
nSrc = end
// Next quickSpan.
var err error
end = rb.nsrc
eof := atEOF
if n := nSrc + len(dst) - nDst; n < end {
@@ -79,7 +80,7 @@ func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)
nSrc += n
nDst += n
if ok {
if err == nil && n < rb.nsrc && !atEOF {
if err == nil && nSrc < rb.nsrc {
err = transform.ErrShortSrc
}
return nDst, nSrc, err
+2 -2
View File
@@ -419,8 +419,8 @@ golang.org/x/sys/windows/registry
# golang.org/x/term v0.45.0
## explicit; go 1.25.0
golang.org/x/term
# golang.org/x/text v0.41.0
## explicit; go 1.25.0
# golang.org/x/text v0.42.0
## explicit; go 1.26.0
golang.org/x/text/feature/plural
golang.org/x/text/internal
golang.org/x/text/internal/catmsg