* Parses a group, essentially returning the string formed by the * brace-enclosed tokens plus some position information.
(
optional: boolean,
)
| 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 |
no test coverage detected