Import Debian changes 0.2.0-1
golang-github-rivo-uniseg (0.2.0-1) unstable; urgency=medium
* New upstream release
* reverse dependencies successfully built with ratt:
- nothing todo for this package
Thorsten Alteholz
3 years ago
|
0 |
golang-github-rivo-uniseg (0.2.0-1) unstable; urgency=medium
|
|
1 |
|
|
2 |
* New upstream release
|
|
3 |
* reverse dependencies successfully built with ratt:
|
|
4 |
- nothing todo for this package
|
|
5 |
|
|
6 |
-- Thorsten Alteholz <debian@alteholz.de> Sun, 13 Dec 2020 19:01:53 +0000
|
|
7 |
|
0 | 8 |
golang-github-rivo-uniseg (0.1.0-2) unstable; urgency=medium
|
1 | 9 |
|
2 | 10 |
* upload source package
|
0 | 0 |
Source: golang-github-rivo-uniseg
|
1 | |
Section: devel
|
|
1 |
Section: golang
|
2 | 2 |
Priority: optional
|
3 | 3 |
Maintainer: Debian Go Packaging Team <team+pkg-go@tracker.debian.org>
|
4 | 4 |
Uploaders:
|
0 | 0 |
version=4
|
1 | 1 |
opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/golang-github-rivo-uniseg-\$1\.tar\.gz/,\
|
2 | 2 |
uversionmangle=s/(\d)[_\.\-\+]?(RC|rc|pre|dev|beta|alpha)[.]?(\d*)$/\$1~\$2\$3/ \
|
3 | |
https://github.com/rivo/uniseg/tags .*/v?(\d\S*)\.tar\.gz
|
|
3 |
https://github.com/rivo/uniseg/tags .*/v?(\d\S*)\.tar\.gz debian uupdate
|
0 | 0 |
package uniseg
|
|
1 |
|
|
2 |
import "unicode/utf8"
|
1 | 3 |
|
2 | 4 |
// The states of the grapheme cluster parser.
|
3 | 5 |
const (
|
|
117 | 119 |
|
118 | 120 |
// NewGraphemes returns a new grapheme cluster iterator.
|
119 | 121 |
func NewGraphemes(s string) *Graphemes {
|
120 | |
g := &Graphemes{}
|
121 | |
for index, codePoint := range s {
|
122 | |
g.codePoints = append(g.codePoints, codePoint)
|
123 | |
g.indices = append(g.indices, index)
|
124 | |
}
|
125 | |
g.indices = append(g.indices, len(s))
|
|
122 |
l := utf8.RuneCountInString(s)
|
|
123 |
codePoints := make([]rune, l)
|
|
124 |
indices := make([]int, l+1)
|
|
125 |
i := 0
|
|
126 |
for pos, r := range s {
|
|
127 |
codePoints[i] = r
|
|
128 |
indices[i] = pos
|
|
129 |
i++
|
|
130 |
}
|
|
131 |
indices[l] = len(s)
|
|
132 |
g := &Graphemes{
|
|
133 |
codePoints: codePoints,
|
|
134 |
indices: indices,
|
|
135 |
}
|
126 | 136 |
g.Next() // Parse ahead.
|
127 | 137 |
return g
|
128 | 138 |
}
|