Debian Codegraph @

unicode/norm/input.go

raw symbols SCIP
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package normscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/
6
7 import "unicode/utf8scip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/"
8
9 type inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input# struct {
10 strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str. string
11 bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. []byte
12 }
13
14 func inputBytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/inputBytes().(str []byte) inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input# {
15 return inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#{bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.: str}
16 }
17
18 func inputStringscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/inputString().(str string) inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input# {
19 return inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#{strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.: str}
20 }
21
22 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) setBytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#setBytes().(str []byte) {
23 in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str. = ""
24 in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. = str
25 }
26
27 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) setStringscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#setString().(str string) {
28 in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str. = str
29 in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. = nil
30 }
31
32 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) _bytescip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#_byte().(p int) byte {
33 if in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. == nil {
34 return in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.[p]
35 }
36 return in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.[p]
37 }
38
39 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) skipASCIIscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#skipASCII().(p, max int) int {
40 if in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. == nil {
41 for ; p < max && in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.[p] < utf8scip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/.RuneSelfscip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/RuneSelf.; p++ {
42 }
43 } else {
44 for ; p < max && in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.[p] < utf8scip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/.RuneSelfscip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/RuneSelf.; p++ {
45 }
46 }
47 return p
48 }
49
50 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) skipContinuationBytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#skipContinuationBytes().(p int) int {
51 if in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. == nil {
52 for ; p < len(in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.) && !utf8scip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/.RuneStartscip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/RuneStart().(in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.[p]); p++ {
53 }
54 } else {
55 for ; p < len(in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.) && !utf8scip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/.RuneStartscip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/RuneStart().(in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.[p]); p++ {
56 }
57 }
58 return p
59 }
60
61 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) appendSlicescip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#appendSlice().(buf []byte, b, e int) []byte {
62 if in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. != nil {
63 return append(buf, in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.[b:e]...)
64 }
65 for i := b; i < e; i++ {
66 buf = append(buf, in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.[i])
67 }
68 return buf
69 }
70
71 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) copySlicescip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#copySlice().(buf []byte, b, e int) int {
72 if in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. == nil {
73 return copy(buf, in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.[b:e])
74 }
75 return copy(buf, in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.[b:e])
76 }
77
78 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) charinfoNFCscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#charinfoNFC().(p int) (uint16, int) {
79 if in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. == nil {
80 return nfcDatascip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/nfcData..lookupStringscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/nfcTrie#lookupString().(in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.[p:])
81 }
82 return nfcDatascip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/nfcData..lookupscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/nfcTrie#lookup().(in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.[p:])
83 }
84
85 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) charinfoNFKCscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#charinfoNFKC().(p int) (uint16, int) {
86 if in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. == nil {
87 return nfkcDatascip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/nfkcData..lookupStringscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/nfkcTrie#lookupString().(in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.[p:])
88 }
89 return nfkcDatascip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/nfkcData..lookupscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/nfkcTrie#lookup().(in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.[p:])
90 }
91
92 func (in *inputscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#) hangulscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#hangul().(p int) (r rune) {
93 var size int
94 if in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes. == nil {
95 if !isHangulStringscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/isHangulString().(in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.[p:]) {
96 return 0
97 }
98 r, size = utf8scip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/.DecodeRuneInStringscip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/DecodeRuneInString().(in.strscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#str.[p:])
99 } else {
100 if !isHangulscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/isHangul().(in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.[p:]) {
101 return 0
102 }
103 r, size = utf8scip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/.DecodeRunescip-go gomod github.com/golang/go/src go1.25.0 `unicode/utf8`/DecodeRune().(in.bytesscip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/input#bytes.[p:])
104 }
105 if size != hangulUTF8Sizescip-go gomod golang.org/x/text . `golang.org/x/text/unicode/norm`/hangulUTF8Size. {
106 return 0
107 }
108 return r
109 }