import type { ScopeTransform , Parser } from "../api.js" ; import { xform } from "../combinators/xform.js" ; /**
 * Assigns given `id` to AST node. E.g. used for re-labeling parser
 * results defined by  defGrammar .
 *
 *  param id export const xfID = ( id ) : ScopeTransform < any > => ( scope ) => ( ( scope ! . id = id ) , scope ) ; export const withID = < T > ( id , parser ) => xform ( parser , xfID ( id ) ) ;