()
| 70 | this.#tokenized = this.#tokenize(); |
| 71 | } |
| 72 | parse(): JsonValue { |
| 73 | const token = this.#getNext(); |
| 74 | const res = this.#parseJsonValue(token); |
| 75 | |
| 76 | // make sure all characters have been read |
| 77 | const { done, value } = this.#tokenized.next(); |
| 78 | if (!done) { |
| 79 | throw new SyntaxError(buildErrorMessage(value)); |
| 80 | } |
| 81 | |
| 82 | return res; |
| 83 | } |
| 84 | /** Read the next token. If the token is read to the end, it throws a SyntaxError. */ |
| 85 | #getNext(): Token { |
| 86 | const { done, value } = this.#tokenized.next(); |
no test coverage detected