Changeset 7991c7d


Ignore:
Timestamp:
Jul 1, 2022, 5:34:23 PM (21 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
f37d9e7
Parents:
120867e
Message:

change enumerator_value_opt to only parse constant_expression

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r120867e r7991c7d  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat May 14 09:16:22 2022
    13 // Update Count     : 5401
     12// Last Modified On : Fri Jul  1 15:35:08 2022
     13// Update Count     : 5405
    1414//
    1515
     
    24412441        // empty
    24422442                { $$ = nullptr; }
    2443         // | '=' constant_expression
    2444         //      { $$ = $2; }
    2445         | simple_assignment_operator initializer
    2446                 { $$ = $1 == OperKinds::Assign ? $2 : $2->set_maybeConstructed( false ); }
     2443        | '=' constant_expression                                       { $$ = new InitializerNode( $2 ); }
     2444        | '=' '{' initializer_list_opt comma_opt '}' { $$ = new InitializerNode( $3, true ); }
     2445        // | simple_assignment_operator initializer
     2446        //      { $$ = $1 == OperKinds::Assign ? $2 : $2->set_maybeConstructed( false ); }
    24472447        ;
    24482448
Note: See TracChangeset for help on using the changeset viewer.