Add entry and description for the triadic NewArray operator.#182
Draft
Radnyx wants to merge 1 commit into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the IFC specification documentation to introduce a triadic NewArray operator entry, intended to describe array new-expression semantics that include an optional initializer (e.g., new int[3]{ ... }).
Changes:
- Adds
NewArrayto theTriadicOperatorenumeration. - Documents
TriadicOperator::NewArray, including operand meanings for array allocation/bound/initializer.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+2719
to
+2731
| \ifcSortSection{NewArray}{TriadicOperator} | ||
| Abstract machine operation corresponding to allocating appropriate storage for an array and initializing its elements | ||
| if an initializer is present. | ||
|
|
||
| When used as the value for the \field{assoc} field of a \sortref{Triad}{ExprSort} structure, that structure | ||
| represents the semantic operation for an array \grammar{new-expression}, where | ||
| \begin{itemize} | ||
| \item the first operand designates the array object type | ||
| \item the second operand designates the array bound | ||
| \item the third operand designates the initializer, or is null if no initializer is present | ||
| \end{itemize} | ||
|
|
||
| A null third operand designates absence of an initializer, as in \code{new T[n]}, and is distinct from an empty initializer list. |
Author
There was a problem hiding this comment.
I don't actually think DyadicOperator::NewArray is used?
Author
There was a problem hiding this comment.
It will be soon. I'll update the spec accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example: