lezer-circom
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

lezer-circom

standard-readme compliant license NPM version TypeScript types

A Lezer grammar for the circom language.

⚠️ This is a low-level library for parsing a low-level circom AST - if you're looking for the CodeMirror language extension, you want the codemirror-lang-circom package instead.

⚠️ This grammar is very rough alpha-quality! There are almost certainly bugs.

Table of Contents

Install

npm i lezer-circom

Usage

import { parser } from "lezer-circom"

const tree = parser.parse(`

pragma circom 2.0.1;
// ...

`)

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

GPLv3 © 2021 Joel Gustafson

Dependencies (2)

Dev Dependencies (3)

Package Sidebar

Install

npm i lezer-circom

Weekly Downloads

2

Version

0.1.0

License

GPLv3

Unpacked Size

53.9 kB

Total Files

6

Last publish

Collaborators

  • joelg