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

Method parseCommandList

src/core/kernel.js:71–93  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

69 }
70
71 parseCommandList(parser) {
72 if (parser.hasMore()) {
73 var keyword = parser.currentToken().value;
74 var cmd;
75 try {
76 cmd = parser.parseElement("command");
77 } catch (e) {
78 if (e instanceof ParseRecoverySentinel) {
79 cmd = new FailedCommand(e.parseError, keyword);
80 this.#syncToCommand(parser);
81 } else {
82 throw e;
83 }
84 }
85 if (cmd) {
86 parser.matchToken("then");
87 const next = parser.parseElement("commandList");
88 if (next) cmd.next = next;
89 return cmd;
90 }
91 }
92 return new EmptyCommandListCommand();
93 }
94
95 parseLeaf(parser) {
96 var result = parser.parseAnyOf(this.#leafExpressions);

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected