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

Improved the grammar of local functions #20368

Merged
merged 1 commit into from
Jun 22, 2017
Merged

Improved the grammar of local functions #20368

merged 1 commit into from
Jun 22, 2017

Conversation

svick
Copy link
Contributor

@svick svick commented Jun 21, 2017

The fixes I made:

  • async and unsafe can be both used at the same time.
  • Use underscores instead of dashes, to be consistent with the current version of the spec.
  • Add missing single quotes.

+ ;

+local-function-body
+local_function_body
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Does this rule not already exist with another name we can/should use?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is method_body, but it also allows empty body (';'; for abstract, extern and partial methods), so it's not the same and I think it shouldn't be used here.

Also, it looks like arrow_expression_body does not exist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, arrow_expression_body is referenced from some new specs even though it hasn't made its way into the language yet.

@sharwell sharwell added Community The pull request was submitted by a contributor who is not a Microsoft employee. Area-Language Design labels Jun 21, 2017
+ ;

+local-function-modifiers
+ : (async | unsafe)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why split across two lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the style used by the spec. I think it makes sense to stay consistent with it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@agocke agocke merged commit 35afa30 into dotnet:master Jun 22, 2017
@svick svick deleted the patch-4 branch June 22, 2017 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Language Design cla-already-signed Community The pull request was submitted by a contributor who is not a Microsoft employee.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants