MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / consumeAStringToken

Method consumeAStringToken

packages/core/css/CSS3Parser.ts:341–363  ·  view source on GitHub ↗

* 4.3.4. Consume a string token * https://www.w3.org/TR/css-syntax-3/#consume-a-string-token

()

Source from the content-addressed store, hash-verified

339 * https://www.w3.org/TR/css-syntax-3/#consume-a-string-token
340 */
341 private consumeAStringToken(): InputTokenObject {
342 const char = this.text[this.nextInputCodePointIndex];
343 let result: RegExpExecArray;
344 if (char === "'") {
345 singleQuoteStringRegEx.lastIndex = this.nextInputCodePointIndex;
346 result = singleQuoteStringRegEx.exec(this.text);
347 if (!result) {
348 return null;
349 }
350 this.nextInputCodePointIndex = singleQuoteStringRegEx.lastIndex;
351 } else if (char === '"') {
352 doubleQuoteStringRegEx.lastIndex = this.nextInputCodePointIndex;
353 result = doubleQuoteStringRegEx.exec(this.text);
354 if (!result) {
355 return null;
356 }
357 this.nextInputCodePointIndex = doubleQuoteStringRegEx.lastIndex;
358 }
359
360 // TODO: Handle bad-string.
361 // TODO: Perform string escaping.
362 return { type: TokenObjectType.string, text: result[0] };
363 }
364
365 /**
366 * 4.3.5. Consume a url token

Callers 2

consumeATokenMethod · 0.95
consumeAURLTokenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected