0.1.1 • Published 9 months ago

tree-sitter-compat v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

node-tree-sitter-compat

Compatibility module for old v8 API based language bindings for node-tree-sitter.

Grammars should be updated by running tree-sitter generate so they no longer require this. Also note that the old grammar bindings were not context aware (Won't work in Electron and/or workers).

This is a no-op if called an a Node API based language bindings so you can always just call it on all your languages to have support for both old and new ones.

Usage

import { convertLanguage } from 'tree-sitter-compat';
import Parser from 'tree-sitter';
import JavaScript from 'tree-sitter-javascript';

const parser = new Parser();
parser.setLanguage(convertLanguage(JavaScript));
0.1.1

9 months ago

0.1.0

1 year ago