MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / makeEnumType

Method makeEnumType

src/ast/ast.cpp:149–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148
149 TypeDeclPtr Enumeration::makeEnumType() const {
150 TypeDeclPtr res = nullptr;
151 switch (baseType) {
152 case Type::tInt8:
153 case Type::tUInt8:
154 res = new TypeDecl(Type::tEnumeration8); break;
155 case Type::tInt16:
156 case Type::tUInt16:
157 res = new TypeDecl(Type::tEnumeration16); break;
158 case Type::tInt:
159 case Type::tUInt:
160 res = new TypeDecl(Type::tEnumeration); break;
161 case Type::tInt64:
162 case Type::tUInt64:
163 res = new TypeDecl(Type::tEnumeration64); break;
164 default:
165 DAS_ASSERTF(0, "we should not be here. unsupported enumeration base type.");
166 return nullptr;
167 }
168 res->enumType = const_cast<Enumeration*>(this);
169 return res;
170 }
171
172
173 pair<ExpressionPtr,bool> Enumeration::find ( const string & na ) const {

Callers 5

Module_HVMethod · 0.45
visitMethod · 0.45
visitMethod · 0.45
evalAndFoldMethod · 0.45
makeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected