Changes in / [0e6aba06:8492b85]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r0e6aba06 r8492b85 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Aug 10 09:47:05202413 // Update Count : 673 412 // Last Modified On : Mon Aug 12 10:21:46 2024 13 // Update Count : 6737 14 14 // 15 15 … … 1849 1849 1850 1850 handler_clause: 1851 handler_key '(' push exception_declaration pophandler_predicate_opt ')' compound_statement1852 { $$ = new ClauseNode( build_catch( yylloc, $1, $ 4, $6, $8) ); }1853 | handler_clause handler_key '(' push exception_declaration pophandler_predicate_opt ')' compound_statement1854 { $$ = $1->set_last( new ClauseNode( build_catch( yylloc, $2, $ 5, $7, $9) ) ); }1851 handler_key '(' exception_declaration handler_predicate_opt ')' compound_statement 1852 { $$ = new ClauseNode( build_catch( yylloc, $1, $3, $4, $6 ) ); } 1853 | handler_clause handler_key '(' exception_declaration handler_predicate_opt ')' compound_statement 1854 { $$ = $1->set_last( new ClauseNode( build_catch( yylloc, $2, $4, $5, $7 ) ) ); } 1855 1855 ; 1856 1856 … … 3157 3157 '|' identifier_or_type_name '(' type_list ')' 3158 3158 { $$ = DeclarationNode::newTraitUse( $2, $4 ); } 3159 | '|' '{' push trait_declaration_list pop'}'3160 { $$ = $ 4; }3159 | '|' '{' trait_declaration_list '}' 3160 { $$ = $3; } 3161 3161 // | '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list pop '}' '(' type_list ')' 3162 3162 // { SemanticError( yylloc, "Generic data-type assertion is currently unimplemented." ); $$ = nullptr; } … … 3210 3210 | forall TRAIT identifier_or_type_name '{' '}' // alternate 3211 3211 { $$ = DeclarationNode::newTrait( $3, $1, nullptr ); } 3212 | TRAIT identifier_or_type_name '(' type_parameter_list ')' '{' push trait_declaration_list pop'}'3212 | TRAIT identifier_or_type_name '(' type_parameter_list ')' '{' trait_declaration_list '}' 3213 3213 { 3214 3214 SemanticWarning( yylloc, Warning::DeprecTraitSyntax ); 3215 $$ = DeclarationNode::newTrait( $2, $4, $ 8);3216 } 3217 | forall TRAIT identifier_or_type_name '{' push trait_declaration_list pop'}' // alternate3218 { $$ = DeclarationNode::newTrait( $3, $1, $ 6); }3215 $$ = DeclarationNode::newTrait( $2, $4, $7 ); 3216 } 3217 | forall TRAIT identifier_or_type_name '{' trait_declaration_list '}' // alternate 3218 { $$ = DeclarationNode::newTrait( $3, $1, $5 ); } 3219 3219 ; 3220 3220 3221 3221 trait_declaration_list: // CFA 3222 3222 trait_declaration 3223 | trait_declaration_list pop pushtrait_declaration3224 { $$ = $1->set_last( $ 4); }3223 | trait_declaration_list trait_declaration 3224 { $$ = $1->set_last( $2 ); } 3225 3225 ; 3226 3226 … … 3233 3233 cfa_variable_specifier 3234 3234 | cfa_function_specifier 3235 | cfa_trait_declaring_list pop ',' pushidentifier_or_type_name3236 { $$ = $1->set_last( $1->cloneType( $ 5) ); }3235 | cfa_trait_declaring_list ',' identifier_or_type_name 3236 { $$ = $1->set_last( $1->cloneType( $3 ) ); } 3237 3237 ; 3238 3238 … … 3240 3240 type_specifier declarator 3241 3241 { $$ = $2->addType( $1 ); } 3242 | trait_declaring_list pop ',' pushdeclarator3243 { $$ = $1->set_last( $1->cloneBaseType( $ 5) ); }3242 | trait_declaring_list ',' declarator 3243 { $$ = $1->set_last( $1->cloneBaseType( $3 ) ); } 3244 3244 ; 3245 3245
Note: See TracChangeset
for help on using the changeset viewer.