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