0.1.0 • Published 2 years ago

codemirror-lang-circom v0.1.0

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

codemirror-lang-circom

standard-readme compliant license NPM version TypeScript types

A Codemirror language extension for circom.

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

Table of Contents

Install

npm i codemirror-lang-circom

Usage

import { EditorState } from "@codemirror/state"
import { EditorView } from "@codemirror/view"

import { circomLanguage } from "codemirror-lang-circom"

import { basicSetup } from "@codemirror/basic-setup"
import { defaultHighlightStyle } from "@codemirror/highlight"
import { keymap } from "@codemirror/view"
import { defaultKeymap } from "@codemirror/commands"

const view = new EditorView({
	state: EditorState.create({
		extensions: [
			circomLanguage,
			basicSetup,
			defaultHighlightStyle,
			keymap.of(defaultKeymap),
		],
	}),
	parent: document.querySelector("#editor"),
})

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

API

import type { LRLanguage } from "@codemirror/language"

export const circomLanguage: LRLanguage

Contributing

This is still under active development so I'm probably not interested in issues or PRs until it stabilizes a little.

License

GPLv3 © 2021 Joel Gustafson

0.1.0

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago