Bump the parser to the next UTF-16 code unit.
()
| 1163 | |
| 1164 | /** Bump the parser to the next UTF-16 code unit. */ |
| 1165 | private bump(): void { |
| 1166 | if (this.isEOF()) { |
| 1167 | return |
| 1168 | } |
| 1169 | const code = this.char() |
| 1170 | if (code === 10 /* '\n' */) { |
| 1171 | this.position.line += 1 |
| 1172 | this.position.column = 1 |
| 1173 | this.position.offset += 1 |
| 1174 | } else { |
| 1175 | this.position.column += 1 |
| 1176 | // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair. |
| 1177 | this.position.offset += code < 0x10000 ? 1 : 2 |
| 1178 | } |
| 1179 | } |
| 1180 | |
| 1181 | /** |
| 1182 | * If the substring starting at the current position of the parser has |
no test coverage detected