UNPKG

bramble-parser

Version:

Bramble is a lightweight recursive descent parser that processes .havenfs files, returning a structured Json tree that can be used to construct an in-memory FS representation. The parser is based on line-based grammar, chunk headers, and metadata declarat

21 lines (16 loc) 517 B
import { Bramble } from "./src/index"; export { Bramble } from "./src/index" //* CLI Entrypoint guard if (import.meta.url === `file://${process.argv[1]}`) { const file = process.argv[2] ?? "./src/fixtures/example1.havenfs"; const bramble = new Bramble(file); bramble.run(); bramble.debugFS(); const errors = bramble.getErrors(); if (errors.length > 0) { console.log("Errors found:", errors.length); bramble.logErrors(); } else { console.log("No errors found"); } }