| 199 | } |
| 200 | |
| 201 | func (dec *Decoder) skipString() error { |
| 202 | for dec.cursor < dec.length || dec.read() { |
| 203 | switch dec.data[dec.cursor] { |
| 204 | // found the closing quote |
| 205 | // let's return |
| 206 | case '"': |
| 207 | dec.cursor = dec.cursor + 1 |
| 208 | return nil |
| 209 | // solidus found start parsing an escaped string |
| 210 | case '\\': |
| 211 | dec.cursor = dec.cursor + 1 |
| 212 | err := dec.skipEscapedString() |
| 213 | if err != nil { |
| 214 | return err |
| 215 | } |
| 216 | default: |
| 217 | dec.cursor = dec.cursor + 1 |
| 218 | continue |
| 219 | } |
| 220 | } |
| 221 | return dec.raiseInvalidJSONErr(len(dec.data) - 1) |
| 222 | } |
| 223 | |
| 224 | // Add Values functions |
| 225 | |