@gram-data/gram-parse
TypeScript icon, indicating that this package has built-in type declarations

0.3.11 • Public • Published

From text literal (a)-->(b) to a gram AST.

How to gram-parse

Install:

npm install @gram-data/gram-parse

Parse text into an AST:

import { toAST } from '@gram-data/gram-parse'; 

const src = '(a)-->(b)';
const parsed = toAST(src);

Inspect AST using unist-util-inspect:

const inspect = require('unist-util-inspect');

console.log(inspect(parsed));

Next Steps

  • Transform to js objects using [[gram-value]]
  • Write back to a string using [[gram-stringify]]
  • Introspect the AST using [[gram-ast]]

Readme

Keywords

Package Sidebar

Install

npm i @gram-data/gram-parse

Weekly Downloads

87

Version

0.3.11

License

MIT

Unpacked Size

720 kB

Total Files

23

Last publish

Collaborators

  • akollegger