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

Method addGrammarElement

www/js/_hyperscript.js:1554–1559  ·  view source on GitHub ↗
(name, definition)

Source from the content-addressed store, hash-verified

1552 }
1553 }
1554 addGrammarElement(name, definition) {
1555 if (this.#grammar[name]) {
1556 throw new Error(`Grammar element '${name}' already exists`);
1557 }
1558 this.#grammar[name] = definition;
1559 }
1560 addCommand(keyword, definition) {
1561 var commandGrammarType = keyword + "Command";
1562 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