@chordlang/parser
v0.1.1
Published
Peggy chart-structure parser for chordlang (.cfmd)
Readme
@chordlang/parser
Peggy parser for chordlang chart structure (.cfmd lead sheets).
Parses bar grids, section markers, and metadata directives. Chord tokens are
opaque strings — symbol normalization lives in @chordlang/chord.
The grammar file src/chart.peggy is the format spec.
Install
npm install @chordlang/parserUsage
import { parseChart } from "@chordlang/parser";
const ast = parseChart(`
{title: F Blues}
| F7 | Bb7 | F7 |
`);
// ast.directives, ast.body — bars, sections, barline-end nodesAPI
parseChart(src: string): ChartAST- Types:
ChartAST,Bar,Section,Cell,BodyItem,Directive
