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

Update documentation.html #506

Merged
merged 2 commits into from
Apr 4, 2024
Merged

Update documentation.html #506

merged 2 commits into from
Apr 4, 2024

Conversation

Flamenco
Copy link
Contributor

Add "END OF INPUT" syntax and example.

@hildjj
Copy link
Contributor

hildjj commented Mar 30, 2024

Please ensure you are in the AUTHORS file and add a changelog entry.

@Flamenco
Copy link
Contributor Author

OK. I need to the the example working. I am not sure how it works, so I will remove it for now.

@hildjj
Copy link
Contributor

hildjj commented Mar 30, 2024

To get the examples to work, add your example to docs/js/examples.peggy and run npm run examples to build.

@Flamenco
Copy link
Contributor Author

Thanks! I will update the PR with examples later today.

@Mingun
Copy link
Member

Mingun commented Mar 30, 2024

I think, that you should specially mention, that this is only composite rule which is constructed from two parts. Actually, everyone can approach to this solution, but it may not be immediately obvious.

@hildjj
Copy link
Contributor

hildjj commented Mar 30, 2024

Maybe let's add a section for composite rules? we can add more to it later as desired.

@Flamenco
Copy link
Contributor Author

Its amazing how little information on the web there is about this EOI syntax. I left the example next to the . example for now, because they are related to each other.

@@ -45,3 +45,7 @@ action = match:(" "+ "a" { return location(); }) rest:rest { return {match, rest
alt = match:("a" / "b" / "c") rest:rest { return {match, rest}; }

rest "The rest of the input" = $.*

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this is a nitpick, but can you move your new rule above rest please?


<dd>
<p>Match END OF INPUT. This <em>Bang Dot</em> sequence will match a completely empty input,
or patterns up to the end of input. This is a composite rule;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"patterns up to the end of the rule" isn't clear. I think you mean that it's useful when used as a predicate, but we probably need some more words.

<dd>
<p>Match END OF INPUT. This <em>Bang Dot</em> sequence will match a completely empty input,
or patterns up to the end of input. This is a composite rule;
It should NOT be placed inside a character set or quote.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line seems obvious to me (we don't say this about any of the other primitives), and as such, it was confusing. Maybe remove?

@Flamenco
Copy link
Contributor Author

Flamenco commented Apr 1, 2024

I just trimmed off the fat and kept it simple. I was not sure if including the rebuilt peggy.js was appropriate.

@Flamenco
Copy link
Contributor Author

Flamenco commented Apr 4, 2024

Not sure why my second commit did not show up, but it is now aligned with your comments.

@hildjj hildjj merged commit 7cac9a3 into peggyjs:main Apr 4, 2024
9 checks passed
@Flamenco Flamenco deleted the patch-1 branch April 4, 2024 07:55
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.

None yet

3 participants