a structural diff that understands syntax 🟥🟩
 
 
 
 
 
Go to file
Ben Sobel 321d95d794 Fixed 'raw strings backslash issue'
Fixed 'library type name dot issue'
Worked on 'type cast issue' (unfinished)
2020-07-19 18:28:26 +07:00
queries start highlighting and add to documentation 2020-07-04 19:23:28 +07:00
src Fixed 'raw strings backslash issue' 2020-07-19 18:28:26 +07:00
test Fixed 'raw strings backslash issue' 2020-07-19 18:28:26 +07:00
tester more trailing commas allowed 2020-07-13 09:53:41 +07:00
.gitignore add in tester script that will test all dart files recursively in a directory and print out the first 100 errors, as well as report percentage of lines of tree-sitter parse output that contain errors 2020-07-12 21:53:08 +07:00
README.md start highlighting and add to documentation 2020-07-04 19:23:28 +07:00
binding.gyp more 2020-04-20 11:30:13 +07:00
grammar.js Fixed 'raw strings backslash issue' 2020-07-19 18:28:26 +07:00
index.js add in simple flutter example 2020-07-07 09:32:54 +07:00
package.json Fixed an issue with untyped static class declaration, added tests. 2020-07-12 16:30:11 +07:00
test_all.sh add in tester script that will test all dart files recursively in a directory and print out the first 100 errors, as well as report percentage of lines of tree-sitter parse output that contain errors 2020-07-12 21:53:08 +07:00

README.md

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