difftastic/vendored_parsers/tree-sitter-dart
Wilfred Hughes d0cf8c6d0d Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
..
.vscode Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
assets Rename vendor/ directory 2023-01-10 08:35:01 +07:00
bindings Rename vendor/ directory 2023-01-10 08:35:01 +07:00
queries Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
src Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
test Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
tester Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
tree_sitter Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
.gitignore Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
.gitmodules Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
Cargo.toml Rename vendor/ directory 2023-01-10 08:35:01 +07:00
Dart.g Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
LICENSE Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
README.md Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
binding.gyp Rename vendor/ directory 2023-01-10 08:35:01 +07:00
grammar.js Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
index.js Rename vendor/ directory 2023-01-10 08:35:01 +07:00
package.json Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
pubspec.yaml Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
test.dart Merge commit 'e398400a0b785af3cf571f5a57eccab242f0cdf9' 2023-08-08 23:28:07 +07:00
test_all.sh Rename vendor/ directory 2023-01-10 08:35:01 +07:00
testitem.html Rename vendor/ directory 2023-01-10 08:35:01 +07:00
tree-sitter-dart.wasm Rename vendor/ directory 2023-01-10 08:35:01 +07:00

README.md

tree-sitter-dart

This is a tree-sitter grammar written for the dart programming language. We attempt to adhere as closely as possible to the dart language spec. Initially it was 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