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

Method parseCommandList

www/js/_hyperscript.js:1384–1406  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

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