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

Tweak look peg special docs #283

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

sogaiu
Copy link
Collaborator

@sogaiu sogaiu commented Feb 4, 2025

This PR contains suggested changes to the documentation for the look peg special and attempts to address #281.

For background please see the following issues:

The changes include:

  • Addressing the point made at the top of this comment:

    I don't know when it was decided that lookahead should not produce captures, but in most cases they do. We should fix the docs here.

  • Simplifying the form of the signature and overall text as:

    (look ?offset patt)

    Matches only if patt matches at a fixed offset. offset can be any integer and defaults to 0. The peg will not advance any characters.

I find the new version shorter and clearer. I had found the previous version confusing but failed to think of a good way to improve things. Placing the ? before the offset label wasn't something that occurred to me and am grateful for that and the associated prose.

Thanks to @edsrzf for the original issue and the improved text 👍

@bakpakin bakpakin merged commit c8b5374 into janet-lang:master Feb 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants