Syntax: accept ranges in designated array initializers#468
Closed
chqrlie wants to merge 1 commit intoc2lang:masterfrom
Closed
Syntax: accept ranges in designated array initializers#468chqrlie wants to merge 1 commit intoc2lang:masterfrom
chqrlie wants to merge 1 commit intoc2lang:masterfrom
Conversation
Contributor
chqrlie
commented
Mar 21, 2026
- boudaries may be omitted: lower bound defaults to current index higher bound default to array length minus one and must be specified if array length is omitted.
- C generator assumes this feature is supported by the C compiler
- Note that bouldaries must be specified for gcc and clang
- This extension will be part of the next C2y standard.
- add tests
Member
|
I can think of many more unit tests, now there are only very few tests. like array[4] tests: maybe some with only a left/right limit, that is not the last one etc |
Member
|
I can think of many more unit tests, now there are only very few tests. like array[4] tests: maybe some with only a left/right limit, that is not the last one etc |
5fdf2ff to
e1cb0af
Compare
* boudaries may be omitted: lower bound defaults to current index higher bound default to array length minus one and must be specified if array length is omitted. * C generator assumes this feature is supported by the C compiler - boundaries must be specified for gcc and clang) - this extension will be part of the next C2y standard. * refine error messages for duplicate cases and range overlaps * add tests
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.