From cb455c05e4c9d8bc4f6679ead76eac932431544d Mon Sep 17 00:00:00 2001 From: Patrick Dubroy Date: Sun, 25 Feb 2024 07:02:53 +0100 Subject: [PATCH] Revert "feat(extras): Add stored attributes" This reverts commit 1050ad0a33e904f1d97da0ef0f6e98eff70c9b5c. --- packages/ohm-js/extras/index.d.ts | 16 +--------------- packages/ohm-js/extras/index.mjs | 1 - 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/packages/ohm-js/extras/index.d.ts b/packages/ohm-js/extras/index.d.ts index bc03ee4e..506721be 100644 --- a/packages/ohm-js/extras/index.d.ts +++ b/packages/ohm-js/extras/index.d.ts @@ -1,4 +1,4 @@ -import {BaseActionDict, Grammar, MatchResult, Node, Semantics} from 'ohm-js'; +import {MatchResult, Grammar, Semantics} from 'ohm-js'; interface LineAndColumnInfo { offset: number; @@ -44,17 +44,3 @@ interface Example { * `//- "shouldn't match"`. The examples text is a JSON string. */ export function extractExamples(grammarsDef: string): [Example]; - -export type StoredAttributeSetter = (node: Node, val: T) => T; - -/** - * Add a stored attribute named `attrName` to `semantics`. A stored attribute - * is similar to a normal attribute, but instead of being lazily computed, the - * value for each node is initialized by an initialization operation. - */ -export function addStoredAttribute( - semantics: Semantics, - attrName: string, - initSignature: string, - actionProducer: (setter: StoredAttributeSetter) => BaseActionDict -): Semantics; diff --git a/packages/ohm-js/extras/index.mjs b/packages/ohm-js/extras/index.mjs index 44a8b2f1..4e0b03d7 100644 --- a/packages/ohm-js/extras/index.mjs +++ b/packages/ohm-js/extras/index.mjs @@ -2,4 +2,3 @@ export {getLineAndColumnMessage, getLineAndColumn} from '../src/util.js'; export {VisitorFamily} from './VisitorFamily.js'; export {semanticsForToAST, toAST} from './semantics-toAST.js'; export {extractExamples} from './extractExamples.js'; -export {addStoredAttribute} from './storedAttributes.js';