Changeset 597ddfeb for src


Ignore:
Timestamp:
Apr 8, 2025, 11:06:36 PM (5 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
2572add
Parents:
9fbc40e
Message:

update code for deprecating old type-parameter names: otype, dtype, and ttype

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r9fbc40e r597ddfeb  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 13 09:23:21 2025
    13 // Update Count     : 7255
     12// Last Modified On : Tue Apr  8 18:36:20 2025
     13// Update Count     : 7259
    1414//
    1515
     
    31183118type_parameter:                                                                                 // CFA
    31193119        type_class identifier_or_type_name
    3120                 {
    3121                         typedefTable.addToScope( *$2, TYPEDEFname, "type_parameter 1" );
    3122                         if ( $1 == ast::TypeDecl::Otype ) { SemanticError( yylloc, "otype keyword is deprecated, use T " ); }
    3123                         if ( $1 == ast::TypeDecl::Dtype ) { SemanticError( yylloc, "dtype keyword is deprecated, use T &" ); }
    3124                         if ( $1 == ast::TypeDecl::Ttype ) { SemanticError( yylloc, "ttype keyword is deprecated, use T ..." ); }
    3125                 }
     3120                { typedefTable.addToScope( *$2, TYPEDEFname, "type_parameter 1" ); }
    31263121          type_initializer_opt assertion_list_opt
    31273122                { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); }
     
    31613156type_class:                                                                                             // CFA
    31623157        OTYPE
    3163                 { $$ = ast::TypeDecl::Otype; }
     3158                { SemanticError( yylloc, "otype keyword is deprecated, use T " ); }
    31643159        | DTYPE
    3165                 { $$ = ast::TypeDecl::Dtype; }
     3160                { SemanticError( yylloc, "dtype keyword is deprecated, use T &" ); }
    31663161        | FTYPE
    31673162                { $$ = ast::TypeDecl::Ftype; }
    31683163        | TTYPE
    3169                 { $$ = ast::TypeDecl::Ttype; }
     3164                { SemanticError( yylloc, "ttype keyword is deprecated, use T ..." ); }
    31703165        ;
    31713166
     
    32363231                        $$ = DeclarationNode::newTrait( $2, $4, nullptr );
    32373232                }
    3238         | forall TRAIT identifier_or_type_name '{' '}'          // alternate
     3233        | forall TRAIT identifier_or_type_name '{' '}'          // new alternate
    32393234                { $$ = DeclarationNode::newTrait( $3, $1, nullptr ); }
    32403235        | TRAIT identifier_or_type_name '(' type_parameter_list ')' '{' trait_declaration_list '}'
Note: See TracChangeset for help on using the changeset viewer.