MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / parse

Method parse

src/parsetree/features/bind.js:24–42  ·  view source on GitHub ↗

* Parse bind feature * @param {Parser} parser * @returns {BindFeature | undefined}

(parser)

Source from the content-addressed store, hash-verified

22 * @returns {BindFeature | undefined}
23 */
24 static parse(parser) {
25 if (!parser.matchToken("bind")) return;
26
27 var follows = parser.pushFollows("and", "with", "to");
28 var left;
29 try {
30 left = parser.requireElement("expression");
31 } finally {
32 parser.popFollows(follows);
33 }
34
35 if (!parser.matchToken("and") && !parser.matchToken("with") && !parser.matchToken("to")) {
36 parser.raiseExpected('and', 'with', 'to');
37 }
38
39 var right = parser.requireElement("expression");
40
41 return new BindFeature(left, right);
42 }
43
44 constructor(left, right) {
45 super();

Callers

nothing calls this directly

Calls 5

matchTokenMethod · 0.45
pushFollowsMethod · 0.45
requireElementMethod · 0.45
popFollowsMethod · 0.45
raiseExpectedMethod · 0.45

Tested by

no test coverage detected