Changes in src/Parser/ExpressionNode.cc [ea54f1e:b0d9ff7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
rea54f1e rb0d9ff7 509 509 } // build_varref 510 510 511 QualifiedNameExpr * build_qualified_expr( const DeclarationNode * decl_node, const NameExpr * name ) { 512 Declaration * newDecl = maybeBuild< Declaration >(decl_node); 513 if ( DeclarationWithType * newDeclWithType = dynamic_cast< DeclarationWithType * >( newDecl ) ) { 514 const Type * t = newDeclWithType->get_type(); 515 if ( t ) { 516 if ( const TypeInstType * typeInst = dynamic_cast<const TypeInstType *>( t ) ) { 517 newDecl= new EnumDecl( typeInst->name ); 518 } 519 } 520 } 521 auto ret = new QualifiedNameExpr( newDecl, name->name ); 522 if ( auto e = dynamic_cast<EnumDecl*>(newDecl) ) { 523 auto enumInst = new EnumInstType( Type::Qualifiers(), e ); 524 auto obj = new ObjectDecl( name->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, enumInst, nullptr ); 525 ret->set_var( obj ); 526 } 527 return ret; 528 } 529 530 QualifiedNameExpr * build_qualified_expr( const EnumDecl * decl_node, const NameExpr * name ) { 531 EnumDecl * newDecl = const_cast< EnumDecl * >( decl_node ); 532 return new QualifiedNameExpr( newDecl, name->name ); 533 } 534 511 535 DimensionExpr * build_dimensionref( const string * name ) { 512 536 DimensionExpr * expr = new DimensionExpr( *name );
Note:
See TracChangeset
for help on using the changeset viewer.