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
Simplify the Backus-Naur notation slightly... #569
Comments
It is not the same. The |
If The only real difference between If I am not understanding this correctly, then I would ask for an example of a number that would be allowed under one form but not the other. |
Doh! My bad. You are correct on all counts. Knew I should have reviewed the BNF again before answering. 👼 |
@jameskregar, is the longer form difficult to understand? The current form follows the descriptive text of the standard. It might be true that it can be simplified, but then the reader has to think harder about the implications. That fact probably saved us at least one round of explanations when we were working up the Regex last year, and the year before that. |
With BNF, I generally expect that a literal will only be used when it is impossible (or very awkward) to define an element with other elements alone. When I looked at it and looked at the definitions of So, is it difficult to understand: no, but it did cause me to re-read the digit definition 2 or 3 times to make sure I wasn't missing something. If I was referencing the BNF while reading the descriptive text, then yes, maybe the current way would make more sense. My vote is usually with the simplest form for BNF, and having only 2 options instead of 3 would be slightly simpler. But in the end, either method is technically correct, and this could be more of a style judgement. If the decision is to keep it as is, then I will close the issue, with no hard feelings. |
Ya, I think my inclination would be to fix it as well. Given the definition of |
Well, I am completely new to Github and have never actually used Git, so I don't know how to PR (I assume PR = Pull Request). If someone wants to point me towards a basic tutorial, I'll give it a shot, otherwise I will close it as "Needs a PR". |
It's easy, first you fork the repo, then when you're ready with the changes, you start a PR. Here's some links that might be useful: https://gist.github.com/MarcDiethelm/7303312 |
Looking at the BNF for numeric identifier,
it appears to me that you could simplify it by combining the first 2 alternates. Since <digit> would allow either "0" or <positive digit>, shouldn't
be equivalent?
The text was updated successfully, but these errors were encountered: