Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/trace too verbose #364

Open
jsawbbo opened this issue Jul 20, 2024 · 1 comment
Open

contrib/trace too verbose #364

jsawbbo opened this issue Jul 20, 2024 · 1 comment
Assignees

Comments

@jsawbbo
Copy link

jsawbbo commented Jul 20, 2024

Hi all.

I have just started using PEGTL, so I beg for patience - maybe I overlooked alternatives for this:

I try to implement a grammar for which I find the contrib/trace a bit too verbose in some cases.

I suggest to add a "nofollow" option which still traces the current node but not any child.

I attached a possible implementation. Usage:

struct my_rule : sor</* ... */>, trace_nofollow {};

This will still trace my_rule but nothing under it.

Cheers, George
trace-nofollow.diff.gz

@ColinH ColinH self-assigned this Jul 20, 2024
@ColinH
Copy link
Member

ColinH commented Jul 27, 2024

We looked into this issue, it's a reasonable request for a useful feature! We'd like to take more time to choose a more flexible (disable tracing for sub-tree or individual rules) and/or simpler implementation (no additional vector in the tracer state), and also make it non-intrusive wrt. the grammar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants