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

Method matchToken

www/js/_hyperscript.esm.js:69–75  ·  view source on GitHub ↗
(value, type)

Source from the content-addressed store, hash-verified

67 }
68 // ----- Token matching -----
69 matchToken(value, type) {
70 if (this.#follows.includes(value)) return;
71 type = type || "IDENTIFIER";
72 if (this.currentToken() && this.currentToken().value === value && this.currentToken().type === type) {
73 return this.consumeToken();
74 }
75 }
76 matchOpToken(value) {
77 if (this.currentToken() && this.currentToken().op && this.currentToken().value === value) {
78 return this.consumeToken();

Callers 15

matchAnyTokenMethod · 0.45
parseErrorAndFinallyMethod · 0.45
parseMethod · 0.45
parseMethod · 0.45
matchTokenMethod · 0.45
parseCommandListMethod · 0.45
parseUnaryExpressionMethod · 0.45
parseExpressionMethod · 0.45
parseMethod · 0.45

Calls 2

currentTokenMethod · 0.45
consumeTokenMethod · 0.45

Tested by

no test coverage detected