helixbass / tree-sitter-grep

The Unlicense
4 stars 1 forks source link

Proof-of-concept of exposing crate-level "push"-style API #60

Open helixbass opened 11 months ago

helixbass commented 11 months ago

In this PR:

Not in this PR:

To test: Per the newly added example, you should be able to call the tree_sitter::run_with_callback() function (with a constructed Args instance) and do stuff in the provided callback that has access to the matched tree_sitter::Node, the file path where the match was found, and the source text for that file

Doing stuff via that crate-level API should be roughly as fast as via the command line (I assume) (and performance via the command-line should still be about the same as what it was)

Based on error-types