0.3.0 • Published 2 years ago

lezer-taslx v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

lezer-taslx

standard-readme compliant license NPM version TypeScript types

A Lezer grammar for the tasl mapping language.

⚠️ This is a low-level library for parsing the AST of the mapping language - if you want to parse .taslx files into proper tasl.Mapping objects, you want to use the main tasl package instead.

Table of Contents

Install

npm i lezer-taslx

Usage

import { parser } from "lezer-taslx"

const tree = parser.parse(`# graph-to-dataset.taslx
namespace ex http://example.com/ns/

map ex:BlankNode <= ex:BlankNode (x) => x

map ex:Statement <= ex:Statement (x) => {
  ex:subject   <= x / ex:subject
  ex:predicate <= x / ex:predicate
  ex:object    <= x / ex:object
  ex:graph     <= {} % ex:defaultGraph
}
`)

// do something with tree.cursor() or tree.topNode ...

You can find documentation for the LR parser interface on the Lezer website.

API

import type { LRParser } from "@lezer/lr"

export const parser: LRParser

Testing

Tests use AVA 4 and live in the test directory.

npm run test

Contributing

This library is just intended to export the compiled lezer grammar, so I don't expect to add any features or functionality beyond that. If you find issues with the grammar definition itself please open an issue to discuss them!

License

MIT © 2021 Joel Gustafson

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago