Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/ImplementEnumFunc.cpp

    raf746cc r19313be5  
    156156                                         const ast::ObjectDecl* dstParam,
    157157                                         const ast::ObjectDecl* srcParam) {
    158         // const CodeLocation& location = func->location;
    159         // auto& params = func->params;
    160         // assert(2 == params.size());
    161         // auto dstParam = params.front().strict_as<ast::ObjectDecl>();
    162         // auto srcParam = params.back().strict_as<ast::ObjectDecl>();
    163158        return new ast::CompoundStmt(
    164159            location,
     
    301296        {new ast::ObjectDecl(getLocation(), "_i", new ast::EnumInstType(decl))},
    302297        {new ast::ObjectDecl(getLocation(), "_ret",
    303                              new ast::EnumAttrType(new ast::EnumInstType(decl),
    304                                                    ast::EnumAttribute::Posn))});
     298            new ast::BasicType(ast::BasicKind::UnsignedInt))});
    305299}
    306300
     
    311305        {new ast::ObjectDecl(
    312306            getLocation(), "_ret",
    313             new ast::PointerType(new ast::BasicType{ast::BasicType::Char}))});
     307            new ast::PointerType(new ast::BasicType{ast::BasicKind::Char}))});
    314308}
    315309
     
    364358        attr == ast::EnumAttribute::Value
    365359            ? decl->base
    366             : new ast::PointerType(new ast::BasicType{ast::BasicType::Char}),
     360            : new ast::PointerType(new ast::BasicType{ast::BasicKind::Char}),
    367361        ast::ConstantExpr::from_int(decl->location, decl->members.size()),
    368362        ast::LengthFlag::FixedLen, ast::DimensionFlag::DynamicDim);
     
    440434
    441435    auto addOneExpr = ast::UntypedExpr::createCall( location,
    442         "?+?",
     436        succ? "?+?": "?-?",
    443437        {new ast::VariableExpr(location, param),
    444438        ast::ConstantExpr::from_int(location, 1)}
     
    516510    ast::EnumInstType enumInst(enumDecl->name);
    517511    enumInst.base = enumDecl;
    518     // ast::EnumAttrType attr = ast::EnumAttrType(&enumInst);
    519     // EnumAttrFuncGenerator gen(enumDecl, &enumInst functionNesting);
     512
    520513    EnumAttrFuncGenerator gen(enumDecl, &enumInst, functionNesting);
    521514    gen.generateAndAppendFunctions(declsToAddAfter);
Note: See TracChangeset for help on using the changeset viewer.