|
|
@ -332,8 +332,14 @@ Compound literals |
|
|
============================================ |
|
|
============================================ |
|
|
|
|
|
|
|
|
int main() { |
|
|
int main() { |
|
|
x = (SomeType) { .f1 = 5, .f2 = 6, .f3 = {} }; |
|
|
|
|
|
y = (struct SomeStruct) { 7, 8 }; |
|
|
|
|
|
|
|
|
x = (SomeType) { |
|
|
|
|
|
.f1.f2[f3] = 5, |
|
|
|
|
|
.f4 = {} |
|
|
|
|
|
}; |
|
|
|
|
|
y = (struct SomeStruct) { |
|
|
|
|
|
7, |
|
|
|
|
|
8 |
|
|
|
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
--- |
|
|
--- |
|
|
@ -348,9 +354,14 @@ int main() { |
|
|
(compound_literal_expression |
|
|
(compound_literal_expression |
|
|
(type_descriptor (type_identifier)) |
|
|
(type_descriptor (type_identifier)) |
|
|
(initializer_list |
|
|
(initializer_list |
|
|
(designator (field_identifier)) (number_literal) |
|
|
|
|
|
(designator (field_identifier)) (number_literal) |
|
|
|
|
|
(designator (field_identifier)) (initializer_list))))) |
|
|
|
|
|
|
|
|
(initializer_pair |
|
|
|
|
|
(field_designator (field_identifier)) |
|
|
|
|
|
(field_designator (field_identifier)) |
|
|
|
|
|
(subscript_designator (identifier)) |
|
|
|
|
|
(number_literal)) |
|
|
|
|
|
(initializer_pair |
|
|
|
|
|
(field_designator (field_identifier)) |
|
|
|
|
|
(initializer_list)))))) |
|
|
(expression_statement (assignment_expression |
|
|
(expression_statement (assignment_expression |
|
|
(identifier) |
|
|
(identifier) |
|
|
(compound_literal_expression |
|
|
(compound_literal_expression |
|
|
@ -364,7 +375,6 @@ Compound literals with trailing commas |
|
|
============================================ |
|
|
============================================ |
|
|
|
|
|
|
|
|
int main() { |
|
|
int main() { |
|
|
x = (SomeType) { .f1 = 5, .f2 = 6, }; |
|
|
|
|
|
y = (struct SomeStruct) { 7, 8, }; |
|
|
y = (struct SomeStruct) { 7, 8, }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -375,17 +385,10 @@ int main() { |
|
|
(primitive_type) |
|
|
(primitive_type) |
|
|
(function_declarator (identifier) (parameter_list)) |
|
|
(function_declarator (identifier) (parameter_list)) |
|
|
(compound_statement |
|
|
(compound_statement |
|
|
(expression_statement (assignment_expression |
|
|
|
|
|
(identifier) |
|
|
|
|
|
(compound_literal_expression |
|
|
|
|
|
(type_descriptor (type_identifier)) |
|
|
|
|
|
(initializer_list |
|
|
|
|
|
(designator (field_identifier)) (number_literal) |
|
|
|
|
|
(designator (field_identifier)) (number_literal))))) |
|
|
|
|
|
(expression_statement (assignment_expression |
|
|
|
|
|
(identifier) |
|
|
|
|
|
(compound_literal_expression |
|
|
|
|
|
(type_descriptor (struct_specifier (type_identifier))) |
|
|
|
|
|
(initializer_list |
|
|
|
|
|
(number_literal) |
|
|
|
|
|
(number_literal)))))))) |
|
|
|
|
|
|
|
|
(expression_statement (assignment_expression |
|
|
|
|
|
(identifier) |
|
|
|
|
|
(compound_literal_expression |
|
|
|
|
|
(type_descriptor (struct_specifier (type_identifier))) |
|
|
|
|
|
(initializer_list |
|
|
|
|
|
(number_literal) |
|
|
|
|
|
(number_literal)))))))) |