Parser for Clyde dialogue language.
import { parse } from '@clyde-lang/parser';
const result = parse(`
Hagrid: Yer a wizard, Harry!
Harry: I'm a what?
`);
// result
{
type: 'document',
content: [{
type: 'content',
content: [
{ type: 'line', value: 'Yer a wizard, Harry!', speaker: 'Hagrid' },
{ type: 'line', value: "I'm a what?", speaker: 'Harry' },
{ type: 'line', value: 'this has $everything:', id: 'id_on_first_line', tags: [ 'and_tags' ] },
]
}],
blocks: []
}
npm install @clyde-lang/parser
# or
yarn add @clyde-lang/parser