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
Non-terminal "printableChar" not actually defined #9925
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9925?orig=1 |
@som-snytt said: It would be nice if there were a mechanism to synchronize productions in the summary with snippets in the main text. |
@som-snytt said: Maybe the syntax summary should be chapter 0 of the spec, since people overlook it. |
@dsbos said:
Note that that PR clarifies only what "printable character" in the text refers to. (It doesn't address the fact that
Isn't the syntax summary supposed to be a summary--that is, isn't every grammar production listed in it supposed to be a copy of a production specified elsewhere? (Isn't that the norm for language specifications? It has been in those I've read and worked on.) |
@som-snytt said: Printable also figures into the definition of blank line and multiline string. It would be great to sync the summary <==> main text snippets. That would guarantee everything appears in both places somewhere. Since many alternative productions appear in different sections of the text, I've always consulted the summary. But I've wanted the ability to follow a link back and forth. And searching into the summary is not trivial. |
@SethTisue said: |
@dsbos said (edited on Sep 29, 2016 9:17:19 PM UTC):
First, can I get an answer to my question above about the intent of syntax summary? (Is it the case that each grammar production should be defined in some non-summary chapter, with the syntax summary being only a redundant copy?) |
@dsbos said:
I was calling for some explicit connection (in chapter 1) between The simplest solution would be to copy the (pseudo-?)EBNF entry for |
@dsbos said (edited on Sep 29, 2016 9:12:43 PM UTC): However, most of the non-terminals meant to be associated with the character-classes list right before section 1.1 ( Similarly, I think that that list should be accompanied by (or possibly replaced by) ENBF entries for those non-terminals (copied from what already exists in the syntax summary chapter). |
@som-snytt said: There are a couple of other informal definitions to clarify. So I agree that ENBFing everything is least confusing. I don't know the answer to how the syntax summary is intended. |
@SethTisue said:
that's certainly my understanding. I can't think of an alternative |
@dsbos said: (I'd like to have an HTML specification that has references to non-terminals linked to definitions of the terminals, so that it's easy to traverse to the definition, and, or course, I'd like to have a specification whose syntax summary matches the syntax defined in the body of the specification. Getting there presumably involves creating some little utilities that at least checks for missing links and inconsistencies, but maybe inserts missing links too. Creating such tools might push for switching to a slightly different EBNF syntax. (The current one doesn't have a token terminating each production, so it's not clear how to recognize the end of one production and the beginning of the next (at least without looking ahead for the Is there a good mailing list for discussing the pieces of that improvement? Or should I file a Jira report for the group and maybe sub-reports for the supporting pieces? Or something else? |
@SethTisue said:
yes! scala-internals |
In http://www.scala-lang.org/files/archive/spec/2.11/01-lexical-syntax.html (as of 2016-09-17), the grammar refers to non-terminal
printableChar
.However, neither the EBNF nor the text actually defines
printableChar
.Although nearby text (in section 1.3.4) does refer to printable characters, it never actually specifies that non-terminal
printableChar
represents one. Yes, it might seem obvious that that's the intent in this case, but such intent isn't always clear, and a specification should specify more explicitly.I don't know if the specification maintainers would want to use a modified-EBNF form like:
bq.
printableChar ::= <a printable Unicode character>
or something textual such as "non-terminal
printableChar
represents a printable Unicode character." (Should the verb be "produces" or maybe "maps to"?)The text was updated successfully, but these errors were encountered: