MCPcopy
hub / github.com/inikulin/parse5 / getCurrentLocation

Method getCurrentLocation

packages/parse5/lib/tokenizer/index.ts:266–279  ·  view source on GitHub ↗
(offset: number)

Source from the content-addressed store, hash-verified

264
265 // NOTE: `offset` may never run across line boundaries.
266 protected getCurrentLocation(offset: number): Location | null {
267 if (!this.options.sourceCodeLocationInfo) {
268 return null;
269 }
270
271 return {
272 startLine: this.preprocessor.line,
273 startCol: this.preprocessor.col - offset,
274 startOffset: this.preprocessor.offset - offset,
275 endLine: -1,
276 endCol: -1,
277 endOffset: -1,
278 };
279 }
280
281 protected _runParsingLoop(): void {
282 if (this.inLoop) return;

Callers 9

constructorMethod · 0.95
_createStartTagTokenMethod · 0.95
_createEndTagTokenMethod · 0.95
_createCommentTokenMethod · 0.95
_createAttrMethod · 0.95
prepareTokenMethod · 0.95
_emitEOFTokenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected