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