* Returns a list of parse nodes, determined by the parseFn. * It can be empty only if open token is missing otherwise it will always return non-empty list * that begins with a lex token of openKind and ends with a lex token of closeKind. * Advances the parser to the next lex tok
(openKind, parseFn, closeKind)
| 3174 | * Advances the parser to the next lex token after the closing token. |
| 3175 | */ |
| 3176 | optionalMany(openKind, parseFn, closeKind) { |
| 3177 | if (this.expectOptionalToken(openKind)) { |
| 3178 | const nodes = []; |
| 3179 | do { |
| 3180 | nodes.push(parseFn.call(this)); |
| 3181 | } while (!this.expectOptionalToken(closeKind)); |
| 3182 | return nodes; |
| 3183 | } |
| 3184 | return []; |
| 3185 | } |
| 3186 | /** |
| 3187 | * Returns a non-empty list of parse nodes, determined by the parseFn. |
| 3188 | * This list begins with a lex token of openKind and ends with a lex token of closeKind. |
no test coverage detected