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 classes of keywords #2367

Closed
kwalrath opened this issue Apr 22, 2020 · 1 comment
Closed

Clarify classes of keywords #2367

kwalrath opened this issue Apr 22, 2020 · 1 comment
Assignees
Labels
a.language Relates to the Dart language tour e1-hours Can complete in < 8 hours of normal, not dedicated, work from.team Reported by Dash docs team member p2-medium Necessary but not urgent concern. Resolve when possible.

Comments

@kwalrath
Copy link
Contributor

kwalrath commented Apr 22, 2020

From @eernstg :

I have a couple of drive-by comments, cf. #2358 (comment).

The phrase 'contextual keyword' is not used in the language specification documents. I did use it in a comment in the spec grammar , but only with await and yield. Those two words are special in that they are considered to be reserved words in the body of an async (they cannot be the name of any declaration, which is more strict than built-in identifiers that can't be the name of a type but can be the name of other things).

So it would make sense to single out just await and yield as being contextual keywords (they are currently presented as 'newer' because asynchrony was new some years back, but that's hardly helpful today). So they'd get superscript '1'.

All the words currently marked with superscript '1' would no more be marked with that superscript: extension will be a built-in identifier ('2'), and it's not obvious that we would need to mention async, hide, of, on, show, and sync as special at all: They can be used as the name of any declaration, and they can be used as identifiers in any expression. They do occur explicitly in the grammar, but it's not helpful to teach anybody to keep them in a mental list of special words (to avoid), because there are no special constraints on the use of these words as identifiers.

If we expect this to be a surprise to readers then we could mention async, hide, of, on, show, sync after the table, saying that there are no constraints on the use of those words as identifiers, even though they appear in the grammar.

@kwalrath kwalrath added a.language Relates to the Dart language tour p2-medium Necessary but not urgent concern. Resolve when possible. e1-hours Can complete in < 8 hours of normal, not dedicated, work labels Apr 22, 2020
@kwalrath kwalrath self-assigned this Feb 6, 2021
@atsansone atsansone added the from.team Reported by Dash docs team member label Aug 21, 2023
@atsansone atsansone self-assigned this Feb 15, 2024
@atsansone
Copy link
Contributor

Fixed in #5681 and #5702.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.language Relates to the Dart language tour e1-hours Can complete in < 8 hours of normal, not dedicated, work from.team Reported by Dash docs team member p2-medium Necessary but not urgent concern. Resolve when possible.
Projects
None yet
Development

No branches or pull requests

2 participants