(parser)
| 8729 | this.args = { message, choiceA, choiceB }; |
| 8730 | } |
| 8731 | static parse(parser) { |
| 8732 | if (!parser.matchToken("answer")) return; |
| 8733 | var message = parser.requireElement("expression"); |
| 8734 | var choiceA = null, choiceB = null; |
| 8735 | if (parser.matchToken("with")) { |
| 8736 | parser.pushFollow("or"); |
| 8737 | try { |
| 8738 | choiceA = parser.requireElement("expression"); |
| 8739 | } finally { |
| 8740 | parser.popFollow(); |
| 8741 | } |
| 8742 | parser.requireToken("or"); |
| 8743 | choiceB = parser.requireElement("expression"); |
| 8744 | } |
| 8745 | return new _AnswerCommand(message, choiceA, choiceB); |
| 8746 | } |
| 8747 | resolve(ctx, { message, choiceA, choiceB }) { |
| 8748 | if (choiceA) { |
| 8749 | ctx.result = confirm(String(message)) ? choiceA : choiceB; |
nothing calls this directly
no test coverage detected