-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Spec: Syntax changes. #17943
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
Spec: Syntax changes. #17943
Conversation
4434cdf
to
a77595e
Compare
a77595e
to
1e09225
Compare
docs/_spec/01-lexical-syntax.md
Outdated
``` | ||
as derives end extension infix inline opaque open transparent using | * + - | ||
as derives end extension infix inline opaque |
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.
seems uncomfortably close
as derives end extension infix inline opaque | |
as derives end extension infix inline opaque |
``` | ||
Import ::= ‘import’ ImportExpr {‘,’ ImportExpr} | ||
ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpecifier | ||
| 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.
not seen SimpleRef
on the lexical syntax page, but it is in the Types page
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 normal. SimpleRef
is a syntax-level non-terminal. The lexical syntax page only shows lexer-level tokens.
If a final wildcard `‘*’` is present, all non-`given` importable members ´z´ of ´p´ other than `´x_1, ..., x_n, y_1, ..., y_n´` are also made available under their own unqualified names. | ||
|
||
Non-given import selectors work in the same way for type and term members. | ||
For instance, an import clause `import ´p´.{´x´ => ´y´}` renames the term name `´p´.´x´` to the term name ´y´ and the type name `´p´.´x´` to the type name ´y´. |
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.
For instance, an import clause `import ´p´.{´x´ => ´y´}` renames the term name `´p´.´x´` to the term name ´y´ and the type name `´p´.´x´` to the type name ´y´. | |
For instance, an import clause `import ´p´.´x´ as ´y´` renames the term name `´p´.´x´` to the term name ´y´ and the type name `´p´.´x´` to the type name ´y´. |
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.
lgtm except some style points
This already includes `given` imports, although the rest of contextual abstractions are not there yet.
Because the change it describes was backported to Scala 2 and is already in the spec.
1e09225
to
cbf9d42
Compare
Backports #17943 to the LTS branch. PR submitted by the release tooling. [skip ci]
[skip ci]