(parser)
| 69 | } |
| 70 | |
| 71 | parseCommandList(parser) { |
| 72 | if (parser.hasMore()) { |
| 73 | var keyword = parser.currentToken().value; |
| 74 | var cmd; |
| 75 | try { |
| 76 | cmd = parser.parseElement("command"); |
| 77 | } catch (e) { |
| 78 | if (e instanceof ParseRecoverySentinel) { |
| 79 | cmd = new FailedCommand(e.parseError, keyword); |
| 80 | this.#syncToCommand(parser); |
| 81 | } else { |
| 82 | throw e; |
| 83 | } |
| 84 | } |
| 85 | if (cmd) { |
| 86 | parser.matchToken("then"); |
| 87 | const next = parser.parseElement("commandList"); |
| 88 | if (next) cmd.next = next; |
| 89 | return cmd; |
| 90 | } |
| 91 | } |
| 92 | return new EmptyCommandListCommand(); |
| 93 | } |
| 94 | |
| 95 | parseLeaf(parser) { |
| 96 | var result = parser.parseAnyOf(this.#leafExpressions); |
nothing calls this directly
no test coverage detected