Skip to content
@pest-parser

pest

The Elegant Parser

pest. The Elegant Parser

Join the chat at https://gitter.im/pest-parser/pest Book Docs

pest Continuous Integration codecov Rustc Version 1.56.1+

Crates.io Crates.io

pest is a general purpose parser written in Rust with a focus on accessibility, correctness, and performance. It uses parsing expression grammars (or PEG) as input, which are similar in spirit to regular expressions, but which offer the enhanced expressivity needed to parse complex languages.

Getting started

The recommended way to start parsing with pest is to read the official book.

Other helpful resources:

Repositories

The pest-parser GitHub organization hosts several repositories. The main one is naturally pest where you can find the source code of main pest-related crates.

The pest.rs website is spanned across two repositories:

  • book contains the source code for building the book on pest.rs.
  • site contains the source code for bundling the book with the rest of the website source code (both the playground and the homepage)

There are two tooling-related pest crates:

  • pest-fmt can help to format pest grammars (try it online).
  • ast can help to reduce boilerplate when converting pest parse trees to abstract syntax trees (BTW the pest_consume crate can also help with the parse tree traversing boilerplate).
  • tree-sitter-pest Pest grammar for the tree-sitter.

There are editor plugins for pest:

  • pest.vim can do syntax highlighting of pest grammars in Vim.
  • intellij-pest can do syntax highlighting, completion, refactoring (renaming, extracting rules, inlining) in IntelliJ editors, such as IDEA or CLion, of pest grammars in both external files and in ones embedded in Rust.
  • vscode-pest Pest support for VS Code, via the LSP.
  • zed-pest Pest support for Zed.

Finally, pest3 contains an unfinished effort of pest 3.0 that is stalled for now. You can follow the future progress on this milestone here: feel free to comment on its issues or open a discussion thread.

Projects using pest

You can find more projects and ecosystem tools in the awesome-pest repo.

Pinned Loading

  1. pest pest Public

    The Elegant Parser

    Rust 5k 276

  2. book book Public

    pest book

    JavaScript 50 37

  3. site site Public

    This repo contains the source code for https://pest.rs

    CSS 13 16

Repositories

Showing 10 of 15 repositories
  • book Public

    pest book

    pest-parser/book’s past year of commit activity
    JavaScript 50 Apache-2.0 37 7 (1 issue needs help) 1 Updated Jul 29, 2025
  • zed-pest Public

    Pest support for Zed

    pest-parser/zed-pest’s past year of commit activity
    Rust 15 MIT 1 1 0 Updated Jul 22, 2025
  • pest Public

    The Elegant Parser

    pest-parser/pest’s past year of commit activity
    Rust 5,025 Apache-2.0 276 62 4 Updated Jun 15, 2025
  • awesome-pest Public

    A curated list of resources, projects, and tools using or for the pest parser generator in Rust

    pest-parser/awesome-pest’s past year of commit activity
    109 CC0-1.0 7 0 0 Updated Jun 6, 2025
  • intellij-pest Public

    pest grammar file support for all JetBrains IDEs

    pest-parser/intellij-pest’s past year of commit activity
    Kotlin 36 Apache-2.0 5 357 0 Updated Apr 23, 2025
  • site Public

    This repo contains the source code for https://pest.rs

    pest-parser/site’s past year of commit activity
    CSS 13 Apache-2.0 16 11 (4 issues need help) 1 Updated Mar 25, 2025
  • ast Public
    pest-parser/ast’s past year of commit activity
    Rust 89 Apache-2.0 17 17 (4 issues need help) 0 Updated Jan 26, 2025
  • pest3 Public

    WIP pest 3.0

    pest-parser/pest3’s past year of commit activity
    Rust 15 Apache-2.0 5 6 (5 issues need help) 0 Updated Jan 20, 2025
  • pest-ide-tools Public

    IDE tools for writing pest grammars, using the Language Server Protocol for Visual Studio Code, Vim and other editors

    pest-parser/pest-ide-tools’s past year of commit activity
    Rust 56 Apache-2.0 8 9 10 Updated Sep 9, 2024
  • pest.vim Public

    Vim syntax highlighting for pest PEG grammar files.

    pest-parser/pest.vim’s past year of commit activity
    Vim Script 38 MIT 8 2 0 Updated Apr 25, 2024