Changes in / [c84dd61:2de175ce]
- Location:
- src
- Files:
-
- 2 edited
-
Parser/parser.yy (modified) (4 diffs)
-
Validate/GenericParameter.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rc84dd61 r2de175ce 2694 2694 $$ = DeclarationNode::newEnum( nullptr, $7, true, true, $3 )->addQualifiers( $5 ); 2695 2695 } 2696 | ENUM '(' ')' attribute_list_opt '{' enumerator_list comma_opt '}' 2697 { 2698 $$ = DeclarationNode::newEnum( nullptr, $6, true, true )->addQualifiers( $4 ); 2699 } 2696 2700 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt 2697 2701 { … … 2705 2709 $$ = DeclarationNode::newEnum( $6, $11, true, true, $3, $9 )->addQualifiers( $5 )->addQualifiers( $7 ); 2706 2710 } 2711 | ENUM '(' ')' attribute_list_opt identifier attribute_list_opt 2712 hide_opt '{' enumerator_list comma_opt '}' 2713 { 2714 $$ = DeclarationNode::newEnum( $5, $9, true, true, nullptr, $7 )->addQualifiers( $4 )->addQualifiers( $6 ); 2715 } 2707 2716 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt 2708 2717 hide_opt '{' enumerator_list comma_opt '}' 2709 2718 { 2710 2719 $$ = DeclarationNode::newEnum( $6->name, $10, true, true, $3, $8 )->addQualifiers( $5 )->addQualifiers( $7 ); 2720 } 2721 | ENUM '(' ')' attribute_list_opt typedef_name attribute_list_opt 2722 hide_opt '{' enumerator_list comma_opt '}' 2723 { 2724 $$ = DeclarationNode::newEnum( $5->name, $9, true, true, nullptr, $7 )->addQualifiers( $4 )->addQualifiers( $6 ); 2711 2725 } 2712 2726 | enum_type_nobody … … 2821 2835 2822 2836 cfa_abstract_parameter_declaration: // CFA, new & old style parameter declaration 2823 // empty 2824 { $$ = nullptr; } 2825 | abstract_parameter_declaration 2837 abstract_parameter_declaration 2826 2838 | cfa_identifier_parameter_declarator_no_tuple 2827 2839 | cfa_abstract_tuple … … 3848 3860 // { SemanticError( yylloc, "New array dimension is currently unimplemented." ); $$ = nullptr; } 3849 3861 | '[' push array_type_list pop ']' // CFA 3850 { $$ = DeclarationNode::newArray( $3, nullptr, false ); }3862 { SemanticError( yylloc, "Type array dimension is currently unimplemented." ); $$ = nullptr; } 3851 3863 | multi_array_dimension 3852 3864 ; -
src/Validate/GenericParameter.cpp
rc84dd61 r2de175ce 277 277 const ast::Expr * TranslateDimensionCore::postvisit( 278 278 const ast::TypeExpr * expr ) { 279 if ( auto instType = dynamic_cast<const ast::EnumInstType *>( expr->type.get() ) ) { 280 const ast::EnumDecl * baseEnum = instType->base.get(); 281 return ast::ConstantExpr::from_int( expr->location, baseEnum->members.size() ); 282 } 279 // Does nothing, except prevents matching ast::Expr (above). 283 280 return expr; 284 281 }
Note:
See TracChangeset
for help on using the changeset viewer.