MCPcopy
hub / github.com/formatjs/formatjs / bump

Method bump

packages/icu-messageformat-parser/parser.ts:1165–1179  ·  view source on GitHub ↗

Bump the parser to the next UTF-16 code unit.

()

Source from the content-addressed store, hash-verified

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

Callers 14

parseMessageMethod · 0.95
parseTagMethod · 0.95
parseTagNameMethod · 0.95
tryParseQuoteMethod · 0.95
tryParseUnquotedMethod · 0.95
parseArgumentMethod · 0.95
tryParseArgumentCloseMethod · 0.95
bumpIfMethod · 0.95
bumpToMethod · 0.95

Calls 2

isEOFMethod · 0.95
charMethod · 0.95

Tested by

no test coverage detected