Pest Formatter

Test Crate

Pest Formatter is a tool to format Pest grammar files.

Installation

bash cargo install pest_fmt

Usage

Then use the pestfmt command to format your .pest files.

shell pestfmt .

It will find all .pest files in the current directory and format them.

Output:

```

Pest Formatter

2 files formatted. ```

Usage as a library

Add pest_fmt into your Cargo.toml:

cargo add pest_fmt

Then use the Formatter struct to format pest grammar.

```rust use pest_fmt::Formatter;

let mut fmt = Formatter::new("a={ASCIIDIGIT}"); let out = fmt.format().unwrap(); println!("{out}"); // a = { ASCIIDIGIT } ```

Development Tool Integration

VS Code

https://github.com/pest-parser/pest-ide-tools

License

Mozilla Public License 2.0