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

Clarify the spec by making "empty" more explicit in the examples #22

Closed
ndw opened this issue Dec 17, 2021 · 3 comments
Closed

Clarify the spec by making "empty" more explicit in the examples #22

ndw opened this issue Dec 17, 2021 · 3 comments

Comments

@ndw
Copy link
Contributor

ndw commented Dec 17, 2021

This is an editorial issue, not a substantive one. In the "Hints for Implementors" section, and perhaps elsewhere but this is where I noticed it, there are some rewritings that are optional (in the sense that one of the alternatives is empty). For example: the right hand side of the f-star rule:

f* ⇒ f-star
-f-star: f, f-star; .

I find it very easy to miss the significance of ; . at the end of that rule. I think it would be better if we made it less, uh, "invisible", if you'll forgive the pun. I think three alternatives have floated past in email:

A comment:

f* ⇒ f-star
-f-star: f, f-star; {empty} .

The string ():

f* ⇒ f-star
-f-star: f, f-star; () .

Or an explicit nonterminal:

f* ⇒ f-star
-f-star: f, f-star; empty .
-empty: .

I don't have a strong favorite among those, but I probably lean marginally towards () for its simplicity.

Any of those would draw my attention to a detail that I've read blithely past more than once.

For completeness, I believe []? was also discussed in email, and I think it would do, but it seems just a little more confusing to explain.

@spemberton
Copy link
Member

spemberton commented Dec 17, 2021 via email

@ndw
Copy link
Contributor Author

ndw commented Dec 17, 2021

That sounds fine to me. It still leaves the question of what to do about "?" itself, but it's more obvious what's going on there because the name "option" is a clue, at least for English speakers, and the rule is so simple, there's less to distract one from seeing the significance of ; ..

@spemberton
Copy link
Member

In the one place where empty occurred, it was replaced by (). Closed.

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

No branches or pull requests

2 participants