Skip to main content

tree-sitter-zeek

A Zeek grammar for tree-sitter.

Background

This grammar parses scripts written in the Zeek scripting language.

The goal of this grammar is to facilitate tooling around Zeek scripts. For that reason, its structure resembles Zeek's grammar but differs in a number of ways. For example, it tracks newlines explicitly and relies more strongly on precedence and associativity to resolve ambiguities. Like Zeek's parser, this one currently doesn't name symbols deeply: for example, the grammar features an expr rule that covers any kind of expression, but the choices aren't currently broken down into, say, addition_expr, or_expr, and similars.

Usage

To use the generated parser directly (e.g. via any of tree-sitter's language bindings), clone this repository. Generated sources are tracked in the src directory. You do not need the tree-sitter CLI to use those sources in your tooling, but you'll likely want it anyway to explore the parser. For example, tree-sitter parse <script> produces the script's syntax tree, and tree-sitter highlight <script> shows syntax-highlighted sources.

Building the parser

  • Install tree-sitter on your machine.
  • Generate the parser: run tree-sitter generate.

Testing

You can find the tests in test. This contains a separater corpus directory for tests with tree-sitter test. You can update the baselines with tree-sitter test -u.

There is also a script called parse-zeek-tree.sh which runs the parser on every Zeek script in the Zeek distribution, reporting any errors.

Releasing a new version

To release a new version manually update the version number in the following ecosystem-specific files:

  • package.json: key version
    • package-lock.json: update package.json and run npm install to update the lock file.
  • pyproject.toml: key project.version
  • Cargo.toml: key package.version
  • tree-sitter.json: key metadata.version
  • CMakeLists.txt: VERSION in project call

Once all versions are consistently updated create a version tag vX.Y.Z and push it. We trigger automatic publishing of releases for all tags.

Release files for tree-sitter-zeek 0.2.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tree-sitter-zeek 0.2.16
File Size Uploaded
tree_sitter_zeek-0.2.16.tar.gz 245.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for tree-sitter-zeek 0.2.16
File
tree_sitter_zeek-0.2.16-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details
tree_sitter_zeek-0.2.16-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
tree_sitter_zeek-0.2.16-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.5+ x86-64, Linux glibc 2.17+ x86-64 Details
tree_sitter_zeek-0.2.16-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
tree_sitter_zeek-0.2.16-cp310-abi3-macosx_10_9_x86_64.whl CPython 3.10 abi3 macOS 10.9+ x86-64 Details

Total release size: 982.9 kB

Release files / tree_sitter_zeek-0.2.16.tar.gz

Download URL tree_sitter_zeek-0.2.16.tar.gz
Size 245.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e57fcc7b19c3b156cdcdb69e05cb73e7923c182b556265e102441dc83023d806
BLAKE2b-256 checksum
How to use checksums
d0b82f91209a958710772dc6a1c1e060f56193e73196b06d15d146f60727ed33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_zeek-0.2.16-cp310-abi3-win_arm64.whl

Download URL tree_sitter_zeek-0.2.16-cp310-abi3-win_arm64.whl
Size 92.4 kB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
7228d9df6c0eae00f671770fa7e9e41200f09ccecbe0b1720374f7709330d9a1
BLAKE2b-256 checksum
How to use checksums
acc11ee28bf3954da14895a89cac9e062f1cd22f0ab1ea65bd80a405ffdb13b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_zeek-0.2.16-cp310-abi3-win_amd64.whl

Download URL tree_sitter_zeek-0.2.16-cp310-abi3-win_amd64.whl
Size 95.6 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b7f1b1342ec1e2be65dba5d08396a883583bf26f8850a50eb35a19d963c6ade3
BLAKE2b-256 checksum
How to use checksums
75809fdf5a13569e2856e848f7d7d70846c2c0fbefb6d107cfb74a074dd01f8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_zeek-0.2.16-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL tree_sitter_zeek-0.2.16-cp310-abi3-musllinux_1_2_x86_64.whl
Size 102.9 kB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
f389ba7148bf8eac5f37afb184c8c6a1c79f8a10fb4cb81cbab4fe9356b5217c
BLAKE2b-256 checksum
How to use checksums
4c8a42bca1df671f75f021a1f7920ee0b7b8b23084d7e2d7020b4ebc8f456a02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 146.4 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
74571fd5e533a53f83847003bb6b1aa4afcb92bc0781b303ec3240d3e7e6489c
BLAKE2b-256 checksum
How to use checksums
00c2fb37f997a74d5ef743bc559af6d3b5ffec2e39b2c99bd635baf536f24d72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tree_sitter_zeek-0.2.16-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 111.9 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
85163b2869fe7fe002e23c63b2a2aabbddadc7c3abe0de3005a10cb54ff1ef86
BLAKE2b-256 checksum
How to use checksums
f0f7d29b9e57c7ce73c738e07423ed747591077e733e9fec8c232aa91d9e208d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_zeek-0.2.16-cp310-abi3-macosx_11_0_arm64.whl

Download URL tree_sitter_zeek-0.2.16-cp310-abi3-macosx_11_0_arm64.whl
Size 98.1 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d48ed5383a1b5accd2a13143d11c76fc7e41292146cb2b32ff05eecf3c9687c7
BLAKE2b-256 checksum
How to use checksums
ba756d3633f61733fe4e7407b466ec8df3afa66180aacb01dcc76adcfac0299c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tree_sitter_zeek-0.2.16-cp310-abi3-macosx_10_9_x86_64.whl

Download URL tree_sitter_zeek-0.2.16-cp310-abi3-macosx_10_9_x86_64.whl
Size 90.1 kB
Tags CPython 3.10 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
1baa7a8ab5713a9b8b1a442e13f4c6e9961bfa04d39ff133f11e0d045f3872dd
BLAKE2b-256 checksum
How to use checksums
f900e07bd1bcc8e68f7c299d544e0f3d9b6f9261c2a1e2bba4fd39a6790ca3cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.2.16 This release

8 release files

0.2.15

8 release files

0.2.13

8 release files

0.2.9

8 release files

0.2.8

8 release files

0.2.7

8 release files

0.2.6

8 release files

0.2.5

8 release files

0.2.4

8 release files

0.2.3

8 release files

0.2.2

8 release files

0.2.1

8 release files

0.1.1

8 release files

0.0.1

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page