Changeset b2ddaf3


Ignore:
Timestamp:
Oct 8, 2022, 4:25:24 PM (18 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
95bda0a
Parents:
265e460
Message:

fix parsing bug for attribute at the end of a distribution list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r265e460 rb2ddaf3  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 26 08:45:53 2022
    13 // Update Count     : 5704
     12// Last Modified On : Sat Oct  8 08:21:18 2022
     13// Update Count     : 5709
    1414//
    1515
     
    103103        // distribute declaration_specifier across all declared variables, e.g., static, const, but not __attribute__.
    104104        assert( declList );
    105 //      printf( "distAttr1 typeSpec %p\n", typeSpec ); typeSpec->print( std::cout );
     105        // printf( "distAttr1 typeSpec %p\n", typeSpec ); typeSpec->print( std::cout );
    106106        DeclarationNode * cur = declList, * cl = (new DeclarationNode)->addType( typeSpec );
    107 //      printf( "distAttr2 cl %p\n", cl ); cl->type->print( std::cout );
    108 //      cl->type->aggregate.name = cl->type->aggInst.aggregate->aggregate.name;
     107        // printf( "distAttr2 cl %p\n", cl ); cl->type->print( std::cout );
     108        // cl->type->aggregate.name = cl->type->aggInst.aggregate->aggregate.name;
    109109
    110110        for ( cur = dynamic_cast<DeclarationNode *>( cur->get_next() ); cur != nullptr; cur = dynamic_cast<DeclarationNode *>( cur->get_next() ) ) {
     
    112112        } // for
    113113        declList->addType( cl );
    114 //      printf( "distAttr3 declList %p\n", declList ); declList->print( std::cout, 0 );
     114        // printf( "distAttr3 declList %p\n", declList ); declList->print( std::cout, 0 );
    115115        return declList;
    116116} // distAttr
     
    30433043                        $$ = $6;
    30443044                }
     3045        // global distribution
    30453046        | type_qualifier_list
    30463047                {
     
    30673068        | declaration_qualifier_list type_qualifier_list
    30683069                {
    3069                         if ( ($1->type && $1->type->qualifiers.val) || $2->type->qualifiers.val ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); }
    3070                         if ( ($1->type && $1->type->forall) || $2->type->forall ) forall = true; // remember generic type
     3070                        if ( ($1->type && $1->type->qualifiers.val) || ($2->type && $2->type->qualifiers.val) ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); }
     3071                        if ( ($1->type && $1->type->forall) || ($2->type && $2->type->forall) ) forall = true; // remember generic type
    30713072                }
    30723073          '{' up external_definition_list_opt down '}'          // CFA, namespace
Note: See TracChangeset for help on using the changeset viewer.