Skip to content

Commit 83ef9b2

Browse files
authored
Merge pull request #209 from emacs-tree-sitter/traversal
Improve tree traversal APIs
2 parents 258eaa9 + 3145b28 commit 83ef9b2

File tree

17 files changed

+1073
-231
lines changed

17 files changed

+1073
-231
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,5 @@ jobs:
8989
run: npm install -g tree-sitter-cli@0.19.3
9090
- run: bin/test
9191
if: ${{ !matrix.target }}
92+
- run: bin/test bench
93+
if: ${{ !matrix.target }}

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878
run: npm install -g tree-sitter-cli@0.19.3
7979
- run: bin/test
8080
if: ${{ !matrix.target }}
81+
- run: bin/test bench
82+
if: ${{ !matrix.target }}
8183

8284
- name: Rename cross-build's binary
8385
if: matrix.target

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## [Unreleased]
7+
- Added APIs to traverse the syntax tree: `tsc-traverse-do`, `tsc-traverse-mapc`, `tsc-traverse-iter`. The traversal is depth-first pre-order.
8+
- Improved syntax tree rendering's performance in `tree-sitter-debug`.
9+
- Added optional params `props` and `output` to `tsc-current-node`, which allows retrieving node properties, instead of the node object itself. This enables performance optimizations in uses cases that deal with a large number of nodes.
710

811
## [0.17.0] - 2022-01-29
912
- Added customization option `tsc-dyn-get-from`, which is a list of sources to get the dynamic module `tsc-dyn` from. Its default value is `(:github :compilation)`.

bin/test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ if [[ $* == "watch" ]]; then
1414
else
1515
if [[ $* == "integ" ]]; then
1616
test_mod="tsc-dyn-get-tests.el"
17+
elif [[ $* == "bench" ]]; then
18+
test_mod="tree-sitter-bench.el"
1719
else
1820
test_mod="tree-sitter-tests.el"
1921
fi

bin/test.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ if ($args[0] -eq "watch") {
1111
} else {
1212
if ($args[0] -eq "integ") {
1313
$test_mod = "tsc-dyn-get-tests.el"
14+
} elseif ($args[0] -eq "bench") {
15+
$test_mod = "tree-sitter-bench.el"
1416
} else {
1517
$test_mod = "tree-sitter-tests.el"
1618
}

0 commit comments

Comments
 (0)