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

Method parse

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

Source from the content-addressed store, hash-verified

6559 this.args = { targetValue: target, amount: amountExpr, ...target.lhs };
6560 }
6561 static parse(parser) {
6562 if (!parser.matchToken("decrement")) return;
6563 var amountExpr;
6564 try {
6565 parser.pushFollow("by");
6566 var target = parser.parseElement("assignableExpression");
6567 } finally {
6568 parser.popFollow();
6569 }
6570 while (target.type === "parenthesized") target = target.expr;
6571 if (parser.matchToken("by")) {
6572 amountExpr = parser.requireElement("expression");
6573 }
6574 return new _DecrementCommand(target, amountExpr);
6575 }
6576 resolve(context, args) {
6577 var { targetValue, amount, ...lhs } = args;
6578 targetValue = targetValue ? parseFloat(targetValue) : 0;

Callers

nothing calls this directly

Calls 5

matchTokenMethod · 0.45
pushFollowMethod · 0.45
parseElementMethod · 0.45
popFollowMethod · 0.45
requireElementMethod · 0.45

Tested by

no test coverage detected