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

Method parse

www/js/_hyperscript.js:9867–9881  ·  view source on GitHub ↗

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

(parser)

Source from the content-addressed store, hash-verified

9865 * @returns {BindFeature | undefined}
9866 */
9867 static parse(parser) {
9868 if (!parser.matchToken("bind")) return;
9869 var follows = parser.pushFollows("and", "with", "to");
9870 var left;
9871 try {
9872 left = parser.requireElement("expression");
9873 } finally {
9874 parser.popFollows(follows);
9875 }
9876 if (!parser.matchToken("and") && !parser.matchToken("with") && !parser.matchToken("to")) {
9877 parser.raiseExpected("and", "with", "to");
9878 }
9879 var right = parser.requireElement("expression");
9880 return new _BindFeature(left, right);
9881 }
9882 constructor(left, right) {
9883 super();
9884 this.left = left;

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