(parser)
| 1382 | return commandElement; |
| 1383 | } |
| 1384 | parseCommandList(parser) { |
| 1385 | if (parser.hasMore()) { |
| 1386 | var keyword = parser.currentToken().value; |
| 1387 | var cmd; |
| 1388 | try { |
| 1389 | cmd = parser.parseElement("command"); |
| 1390 | } catch (e) { |
| 1391 | if (e instanceof ParseRecoverySentinel) { |
| 1392 | cmd = new FailedCommand(e.parseError, keyword); |
| 1393 | this.#syncToCommand(parser); |
| 1394 | } else { |
| 1395 | throw e; |
| 1396 | } |
| 1397 | } |
| 1398 | if (cmd) { |
| 1399 | parser.matchToken("then"); |
| 1400 | const next = parser.parseElement("commandList"); |
| 1401 | if (next) cmd.next = next; |
| 1402 | return cmd; |
| 1403 | } |
| 1404 | } |
| 1405 | return new EmptyCommandListCommand(); |
| 1406 | } |
| 1407 | parseLeaf(parser) { |
| 1408 | var result = parser.parseAnyOf(this.#leafExpressions); |
| 1409 | if (result == null) { |
nothing calls this directly
no test coverage detected