-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update imports.md #15321
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 imports.md #15321
Conversation
Without the additional braces making the `SimpleRef.` optional in `ImportExpr`, an expression such as `import java as j` wouldn't technically be accepted by the grammar specification. Co-authored-by: keynmol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @manojo for the PR! I think if we change it here, we should also change it in the syntax.md
file (https://github.com/lampepfl/dotty/blob/main/docs/_docs/reference/syntax.md) and in https://github.com/lampepfl/dotty/blob/main/docs/_docs/internals/syntax.md.
But before we go further, I would like @odersky to approve this change.
No, this case is already covered by the second production for
|
@@ -48,7 +48,7 @@ are offered under settings `-source 3.1-migration -rewrite`. | |||
|
|||
``` | |||
Import ::= ‘import’ ImportExpr {‘,’ ImportExpr} | |||
ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec | |||
ImportExpr ::= { SimpleRef {‘.’ id} ‘.’ } ImportSpec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImportExpr ::= { SimpleRef {‘.’ id} ‘.’ } ImportSpec | |
ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec | |
| SimpleRef `as` id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the right fix.
@odersky thank you for the message. It looks like the reference syntax is indeed correct, but the imports.md file does not currently have the second production for |
Yes, thank you Mano it makes sense! Could you please apply the changes (I can’t do it from GitHub) and re-open the PR? |
Thanks for the fix, Mano! |
Looks like the change in scala#15321 remained a [suggestion](scala#15321 (comment)) and didn't get merged correctly, unfortunately.
Without the additional braces making the
SimpleRef.
optional inImportExpr
, an expression such asimport java as j
wouldn't technically be accepted by the grammar specification.Co-authored-by: @keynmol