Changeset 0f15e3b


Ignore:
Timestamp:
Jan 30, 2023, 8:48:16 PM (22 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
8728104
Parents:
a5f9444
Message:

add alternate syntax using forall with trait

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    ra5f9444 r0f15e3b  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jan 30 19:19:22 2023
    13 // Update Count     : 5858
     12// Last Modified On : Mon Jan 30 20:47:27 2023
     13// Update Count     : 5859
    1414//
    1515
     
    29792979        TRAIT identifier_or_type_name '(' type_parameter_list ')' '{' '}'
    29802980                { $$ = DeclarationNode::newTrait( $2, $4, nullptr ); }
     2981        | FORALL '(' type_parameter_list ')' TRAIT identifier_or_type_name '{' '}' // alternate
     2982                { $$ = DeclarationNode::newTrait( $6, $3, nullptr ); }
    29812983        | TRAIT identifier_or_type_name '(' type_parameter_list ')' '{' push trait_declaration_list pop '}'
    29822984                { $$ = DeclarationNode::newTrait( $2, $4, $8 ); }
     2985        | FORALL '(' type_parameter_list ')' TRAIT identifier_or_type_name '{' push trait_declaration_list pop '}' // alternate
     2986                { $$ = DeclarationNode::newTrait( $6, $3, $9 ); }
    29832987        ;
    29842988
Note: See TracChangeset for help on using the changeset viewer.