Changeset ecb27a7 for src


Ignore:
Timestamp:
May 3, 2017, 2:37:26 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
365da371
Parents:
37466ba0
Message:

dtor operator syntax is now a void-typed expression

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r37466ba0 recb27a7  
    393393        | '(' compound_statement ')'                                            // GCC, lambda expression
    394394                { $$ = new ExpressionNode( build_valexpr( $2 ) ); }
     395        | primary_expression '{' argument_expression_list '}' // CFA
     396                {
     397                        Token fn;
     398                        fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
     399                        $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
     400                }
    395401        ;
    396402
     
    425431        | '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99, compound-literal
    426432                { $$ = new ExpressionNode( build_compoundLiteral( $2, new InitializerNode( $5, true ) ) ); }
    427         | postfix_expression '{' argument_expression_list '}' // CFA
     433        | '^' primary_expression '{' argument_expression_list '}' // CFA
    428434                {
    429435                        Token fn;
    430                         fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
    431                         $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
     436                        fn.str = new string( "^?{}" );                          // location undefined
     437                        $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $2 )->set_last( $4 ) ) );
    432438                }
    433439        ;
     
    730736        | exception_statement
    731737        | asm_statement
    732         | '^' postfix_expression '{' argument_expression_list '}' ';' // CFA
    733                 {
    734                         Token fn;
    735                         fn.str = new string( "^?{}" );                          // location undefined
    736                         $$ = new StatementNode( build_expr( new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $2 )->set_last( $4 ) ) ) ) );
    737                 }
    738         ;
    739738
    740739labeled_statement:
Note: See TracChangeset for help on using the changeset viewer.