tree-sitter-dart

Crates.iotree-sitter-dart
lib.rstree-sitter-dart
version0.0.4
sourcesrc
created_at2023-01-19 16:50:03.667522
updated_at2024-05-07 00:29:54.169231
descriptiondart grammar for the tree-sitter parsing library
homepage
repositoryhttps://github.com/ast-grep/tree-sitter-dart
max_upload_size
id762698
size5,292,038
Herrington Darkholme (HerringtonDarkholme)

documentation

README

tree-sitter-dart

This is a tree-sitter grammar written for the dart programming language. I attempted to adhere as closely as possible to the dart language spec. Initially I started with a copy of the tree-sitter Java grammar which is why there may be a few relics included in here. For the sake of simplifying the syntax tree, many items were made inlined with tree-sitter's "underscore" method of writing rules.

Getting Started

  • Go to the project directory
  • run npm install (first time)
  • run npm run build_init (first time) npm run build (subsequent times)
  • run npm run test

To test a single highlight file

  • run tree-sitter highlight test/highlight/types.dart

To test a single test file

  • run tree-sitter test -f 'testcasefilter'
  • for example tree-sitter test -f 'dart string literals'

To show the output of a parse for a sample file (for example while debugging highlight issues)

  • run tree-sitter parse path/to/file.dart
Commit count: 124

cargo fmt