Skip to content

Utility library generating an ascii tree for the parsing result of your pest grammar

Notifications You must be signed in to change notification settings

Robert42/pest_ascii_tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pest_ascii_tree

pest_ascii_tree

This is a small helper crate useful for quickly debugging your pest grammar. The rules found by parsing the file are formated into an ascii_tree.

It is useful, you you want to quickly debug your grammar without having to write specialized code for handling the Pairs iterator returned by your pest parser.

Example, for whan an output might look like.

 expr
 ├─ expr
 │  ├─ val "u"
 │  ├─ op "+"
 │  └─ expr
 │     ├─ val "v"
 │     ├─ op "+"
 │     └─ val "w"
 ├─ op "+"
 ├─ expr
 │  ├─ val "x"
 │  ├─ op "+"
 │  └─ val "y"
 ├─ op "+"
 └─ val "z"

Please, that the EOI rule is skipped.

About

Utility library generating an ascii tree for the parsing result of your pest grammar

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages