@clyde-lang/parser

Parser for Clyde dialogue language

Usage no npm install needed!

<script type="module">
  import clydeLangParser from 'https://cdn.skypack.dev/@clyde-lang/parser';
</script>

README

Clyde Parser

npm version

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: []
}

Instalation


npm install @clyde-lang/parser

# or

yarn add @clyde-lang/parser