0.3.11 • Published 4 years ago
@gram-data/gram-ops v0.3.11
(ast)-[ops]->(features)
Utility operations for extracting path features from gram
AST.
How to gram-ops
Install:
npm install @gram-data/gram-ops
Build a path
Use [gram-builder] to create a path.
import { node, edge } from '@gram-data/gram-builder';
const left = node('a');
const right = node('b');
const path = edge([left, right], 'right');
Extract features from the path
Extract a node list:
import { nodes } from '@gram-data/gram-ops';
const ns:GramPath[] = nodes(path);
Extract an edge list:
import { nodes } from '@gram-data/gram-ops';
const es:GramPath[] = edges(path);
Next Steps
- Write back to a string using [gram-stringify]
- Introspect the AST using [gram-ast]
0.3.11
4 years ago
0.4.0-alpha.8
4 years ago
0.3.10
4 years ago
0.4.0-alpha.6
4 years ago
0.4.0-alpha.5
4 years ago
0.4.0-alpha.4
4 years ago
0.4.0-alpha.3
5 years ago
0.4.0-alpha.2
5 years ago
0.4.0-alpha.1
5 years ago
0.3.9
5 years ago
0.3.9-alpha.2
5 years ago
0.3.6
5 years ago
0.3.8
5 years ago
0.3.7
5 years ago
0.3.5
5 years ago
0.3.4
5 years ago
0.3.2
5 years ago
0.3.1
5 years ago
0.2.18
5 years ago
0.2.17
5 years ago
0.2.15
5 years ago
0.2.14
5 years ago
0.2.13
5 years ago
0.2.13-alpha.1
5 years ago
0.2.12
5 years ago
0.2.11
5 years ago
0.2.10
5 years ago
0.2.9
5 years ago