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

Only expand selected rules #21

Closed
nichtich opened this issue Feb 27, 2024 · 1 comment
Closed

Only expand selected rules #21

nichtich opened this issue Feb 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@nichtich
Copy link

nichtich commented Feb 27, 2024

Expanding all rules can result in a very complex diagram. An option to select which rules to expand (and/or how many levels of recursion) would help. How about this:

  • change the option --expand to a numeric argument with 0 as default and all alias for a very large number
  • change probably this to decrease expand for each recursion.

This way callers can decide the depth of expansion and get arbitrary selections of the grammar when combined with --start.

@hildjj hildjj added the enhancement New feature or request label Feb 27, 2024
@hildjj
Copy link
Contributor

hildjj commented Feb 27, 2024

If expand starts to require a parameter, that would be a breaking change. If expand takes an optional parameter, it would also be a breaking change to peggy-tracks -e test.peggy. We could add a (somewhat redundant) new option called "depth" or "maxDepth" that would require an integer parameter. 0, the default, would mean no expansion. --expand would set depth to Infinity.

hildjj added a commit to hildjj/peggy-tracks that referenced this issue Feb 27, 2024
@hildjj hildjj closed this as completed in 19cd5ae Feb 28, 2024
hildjj added a commit that referenced this issue Feb 28, 2024
Add support for --depth.  Fixes #21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants