dec decodes the encoding s into z.
(s string)
| 81 | |
| 82 | // dec decodes the encoding s into z. |
| 83 | func (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. |