MCPcopy Create free account
hub / github.com/KaTeX/KaTeX / parseStringGroup

Method parseStringGroup

src/Parser.ts:636–652  ·  view source on GitHub ↗

* Parses a group, essentially returning the string formed by the * brace-enclosed tokens plus some position information.

(
        optional: boolean,
    )

Source from the content-addressed store, hash-verified

634 * brace-enclosed tokens plus some position information.
635 */
636 parseStringGroup(
637 optional: boolean,
638 ): Token | null {
639 const argToken = this.gullet.scanArgument(optional);
640 if (argToken == null) {
641 return null;
642 }
643 let str = "";
644 let nextToken: Token;
645 while ((nextToken = this.fetch()).text !== "EOF") {
646 str += nextToken.text;
647 this.consume();
648 }
649 this.consume(); // consume the end of the argument
650 argToken.text = str;
651 return argToken;
652 }
653
654 /**
655 * Parses a regex-delimited group: the largest sequence of tokens

Callers 4

parseGroupOfTypeMethod · 0.95
parseColorGroupMethod · 0.95
parseSizeGroupMethod · 0.95
parseUrlGroupMethod · 0.95

Calls 3

fetchMethod · 0.95
consumeMethod · 0.95
scanArgumentMethod · 0.80

Tested by

no test coverage detected