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

Method makeFieldType

src/ast/ast_handle.cpp:96–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 }
95
96 TypeDeclPtr BasicStructureAnnotation::makeFieldType ( const string & na, bool isConst ) const {
97 auto it = fields.find(na);
98 if ( it!=fields.end() ) {
99 auto & sfield = it->second;
100 auto t = isConst && sfield.constDecl ? new TypeDecl(*sfield.constDecl) : new TypeDecl(*sfield.decl);
101 if ( sfield.offset != -1U ) {
102 t->ref = true;
103 }
104 return t;
105 } else {
106 return nullptr;
107 }
108 }
109
110 TypeDeclPtr BasicStructureAnnotation::makeSafeFieldType ( const string & na, bool isConst ) const {
111 auto it = fields.find(na);

Callers 6

visitMethod · 0.45
builtin_hasFieldFunction · 0.45
builtin_fieldTypeFunction · 0.45

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected