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,IAAS,OACT,EAAK,aACL,QAAQ,KAAU,QACd,OAAO,WAAW,GAAM,KAAK,oBACjC,QAAQ,KAAU,OACd,MAAM,WAAW,GAAM,KAAK,mBAEpC,OACK,OAAO,MACP,QAAO,GAAQ,EAAK,cACpB,KAAI,GAAQ,CAAC,EAAM,KAAK,OAAO,GAC3B,QAAO,GACJ,GAAI,KAAK,MAAM,WAAW,SAAU,EAAM,cAC7C,KAAI,GAAS,CAAC,EAAM,KAAM,WAAW,GAAO,MAC5C,QAAO,EAAE,EAAM,MACX,EAAK,SAAS,aAAe,kBAAkB,KACnD,KAAI,EAAE,KAAU,OACpB,KAAI,EAAE,EAAM,KAAU,EAAK,YAAc","file":"/npm/@algebraic/ast@1.0.0-alpha.20/node.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@algebraic/ast@1.0.0-alpha.20/node.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const { IsSymbol } = require(\"@algebraic/type/declaration\");\nconst { isArray } = Array;\nconst { is, of, data, union, nullable, array, number, getTypename, or, getKind } = require(\"@algebraic/type\");\nconst union2 = require(\"@algebraic/type/union-new\");\nconst { parameters } = require(\"@algebraic/type\").parameterized;\nconst { Map, List } = require(\"@algebraic/collections\");\nconst tagged = require(\"@algebraic/type/tagged\");\nconst SourceLocation = require(\"./source-location\");\nconst Comment = require(\"./comment\");\nconst ESTreeBridge = require(\"./estree-bridge\");\nconst NodeSymbol = Symbol(\"Node\");\n\n\nconst Node = tagged((name, ...fields) =>\n    Object.assign(ESTreeBridge ([name]) (\n        ...fields,\n        leadingComments     => [nullable(array(Comment)), null],\n        innerComments       => [nullable(array(Comment)), null],\n        trailingComments    => [nullable(array(Comment)), null],\n        start               => [nullable(number), null],\n        end                 => [nullable(number), null],\n        loc                 => [nullable(SourceLocation), null] ),\n        { [NodeSymbol]: true }) );\n\nNode.Node = Node;\nNode[IsSymbol] = value => !!value && !!of(value) && of(value)[NodeSymbol];\n\nmodule.exports = Node;\n\nconst expressions = Object\n    .values(require(\"./expressions\"))\n    .filter(statement =>\n        getTypename(statement).endsWith(\"Expression\") ||\n        getTypename(statement).endsWith(\"Literal\"));\nconst statements = Object\n    .values(require(\"./statements\"))\n    .filter(statement =>\n        getTypename(statement).endsWith(\"Statement\") ||\n        getTypename(statement).endsWith(\"Declaration\") );\n\nObject.assign(module.exports,\n{\n    Expression: or(...expressions),\n    Statement: or(...statements),\n    ...require(\"./property-names\"),\n    ...require(\"./expressions\"),\n    ...require(\"./patterns\"),\n    ...require(\"./statements\"),\n    ...require(\"./program\")\n});\n\n// Deal with union2.\n// Deal with array<X>.\nconst isNodeOrComposite = type =>\n    type === Array ||\n    type[NodeSymbol] ||\n    getKind(type) === union2 &&\n        union2.components(type).some(isNodeOrComposite) ||\n    getKind(type) === union &&\n        union.components(type).some(isNodeOrComposite);\n\nObject\n    .values(Node)\n    .filter(type => type[NodeSymbol])\n    .map(type => [type, data.fields(type)\n        .filter(field =>\n            is (data.field.definition.supplied, field.definition))\n        .map(field => [field.name, parameters(field)[0]])\n        .filter(([name, type]) =>\n            !name.endsWith(\"Comments\") && isNodeOrComposite(type))\n        .map(([name]) => name)])\n    .map(([type, keys]) => type.traversable = keys);\n\n\n/*\nfunction placeholders(type)\n{\n    const name = \"placeholders\";\n    const computed = true;\n    const λdefinition = function ()\n    {\n        const dependencies = type.traversableKeys;\n        const compute = children => dependencies\n            .map(key => children[key].placeholders);\n\n        field.definition.computed(Map(Node.PlaceholderExpression, boolean))\n            ({ dependencies: traversableKeys, compute: children =>  })\n    }\n\n    return data.field.deferred({ name, computed, λdefinition });\n}\n\nfor (const type of Object.values(Node))\n    if (getKind(type) === data)\n        console.log(getTypename(type));*/\n\n"]}