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

Method parseCommandList

www/js/_hyperscript.esm.js:1382–1404  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

1380 return commandElement;
1381 }
1382 parseCommandList(parser) {
1383 if (parser.hasMore()) {
1384 var keyword = parser.currentToken().value;
1385 var cmd;
1386 try {
1387 cmd = parser.parseElement("command");
1388 } catch (e) {
1389 if (e instanceof ParseRecoverySentinel) {
1390 cmd = new FailedCommand(e.parseError, keyword);
1391 this.#syncToCommand(parser);
1392 } else {
1393 throw e;
1394 }
1395 }
1396 if (cmd) {
1397 parser.matchToken("then");
1398 const next = parser.parseElement("commandList");
1399 if (next) cmd.next = next;
1400 return cmd;
1401 }
1402 }
1403 return new EmptyCommandListCommand();
1404 }
1405 parseLeaf(parser) {
1406 var result = parser.parseAnyOf(this.#leafExpressions);
1407 if (result == null) {

Callers

nothing calls this directly

Calls 5

hasMoreMethod · 0.45
currentTokenMethod · 0.45
parseElementMethod · 0.45
#syncToCommandMethod · 0.45
matchTokenMethod · 0.45

Tested by

no test coverage detected