MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / parse

Method parse

tools/common/_hyperscript.iife.js:8281–8296  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 5

matchTokenMethod · 0.45
requireElementMethod · 0.45
pushFollowMethod · 0.45
popFollowMethod · 0.45
requireTokenMethod · 0.45

Tested by

no test coverage detected