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

Method addGrammarElement

www/js/_hyperscript.esm.js:1552–1557  ·  view source on GitHub ↗
(name, definition)

Source from the content-addressed store, hash-verified

1550 }
1551 }
1552 addGrammarElement(name, definition) {
1553 if (this.#grammar[name]) {
1554 throw new Error(`Grammar element '${name}' already exists`);
1555 }
1556 this.#grammar[name] = definition;
1557 }
1558 addCommand(keyword, definition) {
1559 var commandGrammarType = keyword + "Command";
1560 this.#grammar[commandGrammarType] = definition;

Callers 7

constructorMethod · 0.45
registerParseElementMethod · 0.45
addLeafExpressionMethod · 0.45
addIndirectExpressionMethod · 0.45
addPostfixExpressionMethod · 0.45
addUnaryExpressionMethod · 0.45
addTopExpressionMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected