tree_sitter 0.1.2 copy "tree_sitter: ^0.1.2" to clipboard
tree_sitter: ^0.1.2 copied to clipboard

A tree sitter parsing library

example/tree_sitter.dart

import 'dart:io';

import 'package:dylib/dylib.dart';
import 'package:tree_sitter/tree_sitter.dart';

void main() {
  final parser = Parser(
      sharedLibrary: resolveDylibPath('dart', path: Directory.current.path),
      entryPoint: 'tree_sitter_dart');
  // const program = "class A {}";
  const program = r"""
void main() {
  test('', () {
    'åÅ';
    'åÅ';
  });
}
""";
  final tree = parser.parse(program);
  print(tree.root.string);
  print(parser.getText(tree.root.child(0).namedChild(0)));
}
3
likes
25
points
49
downloads

Publisher

unverified uploader

Weekly Downloads

A tree sitter parsing library

Repository (GitHub)

License

MIT (license)

Dependencies

args, dylib, ffi, freezed_annotation, json_annotation, path

More

Packages that depend on tree_sitter