Skip to content

Examples โ€‹

Every example below is a real program in the repository's examples/ directory. Build them all with zig build examples, run one with zig build run-<name> (e.g. zig build run-basic_parse), or run the whole set with zig build run-all-examples.

Basics

Parse source, print trees, inspect nodes, and handle errors.

Beginner

Open the example โ†’

Trees

Walk trees recursively and with cursors.

Beginner

Open the example โ†’

Incremental

Edits, reuse, and changed ranges.

Intermediate

Open the example โ†’

Input

Memory, callbacks, and reader-backed sources.

Intermediate

Open the example โ†’

Languages

Inspect symbols, tables, and fields.

Intermediate

Open the example โ†’

Queries

Captures, predicates, and structural search.

Intermediate

Open the example โ†’

Unicode

UTF-8 offsets, points, and positions.

Intermediate

Open the example โ†’

Debugging

Logging, tracing, and error inspection.

Advanced

Open the example โ†’

Applications

Highlighting, navigation, and analysis patterns.

Advanced

Open the example โ†’

Released under the MIT License.