Ignore:
Timestamp:
Sep 12, 2021, 11:19:05 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
347925c, b5ec090
Parents:
9cdfa5fb
Message:

add C++-style constructor initialization, T t{3,4} versus T t = {3,4}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r9cdfa5fb r63b3279  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Aug  8 09:14:44 2021
    13 // Update Count     : 5038
     12// Last Modified On : Sat Sep 11 08:20:44 2021
     13// Update Count     : 5040
    1414//
    1515
     
    24462446        | simple_assignment_operator initializer        { $$ = $1 == OperKinds::Assign ? $2 : $2->set_maybeConstructed( false ); }
    24472447        | '=' VOID                                                                      { $$ = new InitializerNode( true ); }
     2448        | '{' initializer_list_opt comma_opt '}'        { $$ = new InitializerNode( $2, true ); }
    24482449        ;
    24492450
     
    24592460        | designation initializer                                       { $$ = $2->set_designators( $1 ); }
    24602461        | initializer_list_opt ',' initializer          { $$ = (InitializerNode *)( $1->set_last( $3 ) ); }
    2461         | initializer_list_opt ',' designation initializer
    2462                 { $$ = (InitializerNode *)($1->set_last( $4->set_designators( $3 ) )); }
     2462        | initializer_list_opt ',' designation initializer { $$ = (InitializerNode *)($1->set_last( $4->set_designators( $3 ) )); }
    24632463        ;
    24642464
Note: See TracChangeset for help on using the changeset viewer.