-
Notifications
You must be signed in to change notification settings - Fork 90
Consolidate unsafe-code grammar #233
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
Conversation
With the consolidation of the unsafe grammar in PR #233, this text is no longer needed.
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.
The integration LGTM.
I've made some wordsmithing-only comments relating to repetition and consistency between clauses. These are not hills to die on.
standard/expressions.md
Outdated
; | ||
``` | ||
|
||
*pointer_indirection_expression* is available only in unsafe code ([§23.6.2](unsafe-code.md#2362-pointer-indirection)). *addressof_expression* is available only in unsafe code([§23.6.5](unsafe-code.md#2365-the-address-of-operator)). |
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.
standard/statements.md
Outdated
; | ||
``` | ||
*unsafe_statement* is defined in [§23.2](unsafe-code.md#232-unsafe-contexts). *fixed_statement* is defined in [§23.7](unsafe-code.md#237-the-fixed-statement). |
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.
standard/expressions.md
Outdated
; | ||
``` | ||
|
||
*pointer_member_access* is available only in unsafe code ([§23.6.3](unsafe-code.md#2363-pointer-member-access)). *pointer_element_access* is available only in unsafe code ([§23.6.4](unsafe-code.md#2364-pointer-element-access)). |
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.
standard/statements.md
Outdated
; | ||
``` | ||
|
||
*stackalloc_initializer* is defined in [§23.9](unsafe-code.md#239-stack-allocation). |
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.
Back in expressions.md these statements followed a "is only available in unsafe code" pattern, here in statements.md this is the second to follow an "is define in" pattern which doesn't directly mention "unsafe code". I suggested a change to the first occurrence (in embedded_statement to remove repetition (as suggested in expressions.md as well) which also changed it to the "is only available in unsafe code" pattern.
If there is no particular reason to change the pattern I'd suggest consistency and follow the pattern adopted in expressions.md. I won't flag them all, I've done the first one and this second would be:
stackalloc_initializer (§23.9) is only available in unsafe code (§23).
If there is a good reason to change the pattern that keep it but I'd suggest removing any repetition as suggested above for embedded_statement.
All this is wordsmithing, the text is technically correct.
standard/structs.md
Outdated
; | ||
``` | ||
|
||
*unsafe_modifier* is defined in [§23.2](unsafe-code.md#232-unsafe-contexts). |
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.
Another case of the "x is defined in §clause" pattern as opposed to "x (§clause) is only available in unsafe code[§23]" one.
standard/structs.md
Outdated
; | ||
``` | ||
|
||
*fixed_size_buffer_declaration* is defined in [§23.8.2](unsafe-code.md#2382-fixed-size-buffer-declarations). |
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.
Another case of the "x is defined in §clause" pattern as opposed to "x (§clause) is only available in unsafe code[§23]" one.
standard/types.md
Outdated
; | ||
``` | ||
|
||
A third category of types, pointers, is available only in unsafe code [§23.3](unsafe-code.md#233-pointer-types). | ||
*pointer_type* is available only in unsafe code ([§23.3](unsafe-code.md#233-pointer-types)). |
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.
@RexJaeschke, @BillWagner, @sharwell – I've approved the PR but haven't checked the grammar does what we think it should as I'm still using standard Antlr as Sam's fork isn't working for me and I've yet to figure out what dumb thing I've done to break it! |
Thanks @Nigel-Ecma. I fixed all those instances you pointed out plus all "is defined in" instances in classes.md and interfaces.md. |
The definition of an unmanaged_type was moved to §9.8 by PR #233. However, the old, now duplicate, definition still resides in 23.3, “Pointer types.” That duplicate is being deleted. Also, an Example table does not render correctly; the table header is treated as run-on text to the previous line:
The definition of an unmanaged_type was moved to §9.8 by PR #233. However, the old, now duplicate, definition still resides in 23.3, “Pointer types.” That duplicate is being deleted. Also, an Example table does not render correctly; the table header is treated as run-on text to the previous line:
With the consolidation of the unsafe grammar in PR #233, this text is no longer needed.
With the consolidation of the unsafe grammar in PR #233, this text is no longer needed.
With the consolidation of the unsafe grammar in PR #233, this text is no longer needed.
* Update statements.md * Update unsafe-code.md * Add semantics and example for local functions v7.0 feature * removed local function unsafe grammar extension With the consolidation of the unsafe grammar in PR #233, this text is no longer needed. * include support for local functions * add support for local functions * fix build issues * Apply suggestions from code review Co-authored-by: KalleOlaviNiemitalo <[email protected]> * clarify definite assignment, add examples Addresses comments in committee meeting: - #104 (comment) - #104 (comment) * respond to feedback. * grammar updates * Incorporate Andy's text In this commit, create the new clause for the definite assignment rules for local functions. Move the existing example to that clause. Add text from Andy's comments and notes. * finish local functions and definite assignment. Incorporate the rules for definite assignment for captured variables in local functions. This is both for local function calls and for delegate conversion. * typo * Apply suggestions from code review Co-authored-by: Nigel-Ecma <[email protected]> * Apply suggestions from code review * Update standard/statements.md Co-authored-by: Jon Skeet <[email protected]> * Update standard/statements.md * Update standard/statements.md Co-authored-by: Neal Gafter <[email protected]> * Update standard/statements.md * Update standard/statements.md * edits based on September committee meeting * fix link text * fix section renumbering issue * Final edits We resolved these two discussions during the committee meeting. Edits reflect those decisions. * updates from code review. * one more bit of feedback. Co-authored-by: Bill Wagner <[email protected]> Co-authored-by: KalleOlaviNiemitalo <[email protected]> Co-authored-by: Nigel-Ecma <[email protected]> Co-authored-by: Jon Skeet <[email protected]> Co-authored-by: Neal Gafter <[email protected]>
The definition of an unmanaged_type was moved to §9.8 by PR dotnet/csharpstandard#233. However, the old, now duplicate, definition still resides in 23.3, “Pointer types.” That duplicate is being deleted. Also, an Example table does not render correctly; the table header is treated as run-on text to the previous line:
This PR resolves #37, Proposal 6.