Changeset c744563a for src/Parser


Ignore:
Timestamp:
Feb 21, 2020, 2:53:03 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
a505021
Parents:
2cbfe92
Message:

add attributes on new style function specifier [fixes #161]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r2cbfe92 rc744563a  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 08:22:14 2020
    13 // Update Count     : 4461
     12// Last Modified On : Fri Feb 21 14:47:29 2020
     13// Update Count     : 4468
    1414//
    1515
     
    15891589                // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be
    15901590                // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name.
    1591         cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')'
     1591        cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt
    15921592                // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator).
    1593                 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); }
    1594         | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')'
    1595                 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); }
     1593                { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 )->addQualifiers( $8 ); }
     1594        | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt
     1595                { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 )->addQualifiers( $8 ); }
    15961596        ;
    15971597
Note: See TracChangeset for help on using the changeset viewer.