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