stack-graphs/tree-sitter-stack-graphs/examples
Hendrik van Antwerpen be38049672 Update README to include some usage guidance 2024-01-11 14:02:34 -08:00
..
modules Add modules example 2022-09-19 14:27:33 +02:00
nested-scope Add nested scoping example 2022-09-15 19:25:18 +02:00
sequential-definitions Add sequential definitions example 2022-09-15 19:27:21 +02:00
.gitignore Add option to save visualization to run script 2022-09-16 12:17:52 +02:00
README.md Update README to include some usage guidance 2024-01-11 14:02:34 -08:00
bootstrap Add convenience scripts for running the examples 2022-09-15 20:28:11 +02:00
parse Add parse script to examples 2022-10-05 20:23:30 +02:00
run Add option to save visualization to run script 2022-09-16 12:17:52 +02:00

README.md

Examples

Each directory contains a small example highlighting a particular name binding pattern. The examples use Python syntax, but do not necessarily implement Python semantics. Each directory contains a stack-graphs.tsg file that describes at the top what behavior it implements, and a tests directory showcasing the behavior.

Running the examples requires the Python grammar to be available. This can be installed (in this directory) by executing:

./bootstrap

Run the tests for an example by executing:

./run EXAMPLE_DIR

or, from within the example's directory:

../run

To render HTML visualizations of the stack graphs for the tests in an example, add the -V flag to run.

Print the parse tree of an example file by executing:

./parse EXAMPLE_FILE

The following examples are available: