MCPcopy Index your code
hub / github.com/google/codesearch / dec

Method dec

regexp/match.go:83–108  ·  view source on GitHub ↗

dec decodes the encoding s into z.

(s string)

Source from the content-addressed store, hash-verified

81
82// dec decodes the encoding s into z.
83func (z *nstate) dec(s string) {
84 b := []byte(s)
85 i, n := binary.Uvarint(b)
86 if n <= 0 {
87 bug()
88 }
89 b = b[n:]
90 z.partial = rune(i)
91 i, n = binary.Uvarint(b)
92 if n <= 0 {
93 bug()
94 }
95 b = b[n:]
96 z.flag = flags(i)
97 z.q.Reset()
98 last := ^uint32(0)
99 for len(b) > 0 {
100 i, n = binary.Uvarint(b)
101 if n <= 0 {
102 bug()
103 }
104 b = b[n:]
105 last += uint32(i)
106 z.q.Add(last)
107 }
108}
109
110// dmatch is the state we're in when we've seen a match and are just
111// waiting for the end of the line.

Callers 2

TestNstateEncFunction · 0.95
computeNextMethod · 0.80

Calls 4

bugFunction · 0.85
flagsTypeAlias · 0.85
ResetMethod · 0.80
AddMethod · 0.45

Tested by 1

TestNstateEncFunction · 0.76