Skip to content

underlay/lezer-tasl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lezer-tasl

standard-readme compliant license NPM version TypeScript types

A Lezer grammar for the tasl schema language.

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

Table of Contents

Install

npm i lezer-tasl

Usage

import { parser } from "lezer-tasl"

const tree = parser.parse(`# hello world
namespace s http://schema.org/

class s:Person {
  s:name -> string
}
`)

// 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

About

A Lezer grammar for the tasl schema language

Resources

License

Stars

Watchers

Forks

Packages

No packages published