(parser)
| 8279 | this.args = { message, choiceA, choiceB }; |
| 8280 | } |
| 8281 | static parse(parser) { |
| 8282 | if (!parser.matchToken("answer")) return; |
| 8283 | var message = parser.requireElement("expression"); |
| 8284 | var choiceA = null, choiceB = null; |
| 8285 | if (parser.matchToken("with")) { |
| 8286 | parser.pushFollow("or"); |
| 8287 | try { |
| 8288 | choiceA = parser.requireElement("expression"); |
| 8289 | } finally { |
| 8290 | parser.popFollow(); |
| 8291 | } |
| 8292 | parser.requireToken("or"); |
| 8293 | choiceB = parser.requireElement("expression"); |
| 8294 | } |
| 8295 | return new _AnswerCommand(message, choiceA, choiceB); |
| 8296 | } |
| 8297 | resolve(ctx, { message, choiceA, choiceB }) { |
| 8298 | if (choiceA) { |
| 8299 | ctx.result = confirm(String(message)) ? choiceA : choiceB; |
nothing calls this directly
no test coverage detected