Ignore:
Timestamp:
Oct 2, 2017, 6:37:18 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
1155718
Parents:
1033f5d
Message:

move constructor call from primary to postfix expression

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r1033f5d rbd3d9e4  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Sep 23 17:43:15 2017
    13 // Update Count     : 2829
     12// Last Modified On : Mon Oct  2 18:18:55 2017
     13// Update Count     : 2835
    1414//
    1515
     
    456456        | '(' compound_statement ')'                                            // GCC, lambda expression
    457457                { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); }
    458         | primary_expression '{' argument_expression_list '}' // CFA, constructor call
    459                 {
    460                         Token fn;
    461                         fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
    462                         $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
    463                 }
    464458        | type_name '.' no_attr_identifier                                      // CFA, nested type
    465459                { $$ = nullptr; }                                                               // FIX ME
     
    476470                // equivalent to the old x[i,j].
    477471                { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $4 ) ); }
     472        | postfix_expression '{' argument_expression_list '}' // CFA, constructor call
     473                {
     474                        Token fn;
     475                        fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
     476                        $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
     477                }
    478478        | postfix_expression '(' argument_expression_list ')'
    479479                { $$ = new ExpressionNode( build_func( $1, $3 ) ); }
Note: See TracChangeset for help on using the changeset viewer.