Skip to content

Commit

Permalink
feature: added a pest_debugger crate (fixes #98) (#736)
Browse files Browse the repository at this point in the history
* feature: added a `pest_debugger` crate (fixes #98)

based on the old PR by @dragostis: #277

Changes that were made:
- debugger core context was refactored and extracted to a lib (so that
it could be used in other frontends, e.g. editor plugins)
- CLI was extended using rustyline helpers to provide file completions,
history etc.
- applied suggestions from @hansihe from the old PR
(#277 (comment)):
1. added `ba` (add breakpoints at all rules) which is useful
for stepping through the entire grammar, plus breakpoint deletions
and loading input directly from readline;
2. added command line arguments.
- changed the listener function to return a boolean, so that
the debugger can signal back to a parsing thread to finish
before reaching its input's EOF.

Co-authored-by: Tomas Tauber <me@tomtau.be>
Co-authored-by: Dragoș Tiselice <dragostiselice@gmail.com>
  • Loading branch information
3 people committed Nov 24, 2022
1 parent 0ba8386 commit 8c602d8
Show file tree
Hide file tree
Showing 18 changed files with 943 additions and 51 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
@@ -1,6 +1,7 @@
[workspace]
members = [
"bootstrap",
"debugger",
"derive",
"generator",
"grammars",
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
@@ -1,6 +1,7 @@
comment: off

ignore:
- debugger/src/main.rs
- derive/src/lib.rs
- pest/examples/parens.rs
- pest/src/unicode/*
26 changes: 26 additions & 0 deletions debugger/Cargo.toml
@@ -0,0 +1,26 @@
[package]
name = "pest_debugger"
description = "pest grammar debugger"
version = "2.5.0"
edition = "2021"
authors = ["Dragoș Tiselice <dragostiselice@gmail.com>", "Tomas Tauber <me@tomtau.be>"]
homepage = "https://pest.rs/"
repository = "https://github.com/pest-parser/pest"
documentation = "https://docs.rs/pest"
keywords = ["pest", "grammar", "debugger"]
categories = ["parsing"]
license = "MIT/Apache-2.0"
readme = "_README.md"
rust-version = "1.56"

[dependencies]
pest = { path = "../pest", version = "2.5.0" }
pest_meta = { path = "../meta", version = "2.5.0" }
pest_vm = { path = "../vm", version = "2.5.0" }
rustyline = "10"
thiserror = "1"

[badges]
codecov = { repository = "pest-parser/pest" }
maintenance = { status = "actively-developed" }
github = { repository = "pest-parser/pest" }
1 change: 1 addition & 0 deletions debugger/_README.md

0 comments on commit 8c602d8

Please sign in to comment.