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

Method tupleFieldIndex

src/ast/ast_typedecl.cpp:3474–3490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3472 }
3473
3474 int TypeDecl::tupleFieldIndex( const string & name ) const {
3475 int index = 0;
3476 if ( sscanf(name.c_str(),"_%d",&index)==1 ) {
3477 return index;
3478 } else {
3479 auto vT = isPointer() ? firstType : this;
3480 if (!vT) return -1;
3481 if ( name=="_first" ) {
3482 return 0;
3483 } else if ( name=="_last" ) {
3484 return int(vT->argTypes.size())-1;
3485 } else {
3486 return vT->findArgumentIndex(name);
3487 }
3488 return -1;
3489 }
3490 }
3491
3492 int TypeDecl::variantFieldIndex ( const string & name ) const {
3493 auto vT = isPointer() ? firstType : this;

Callers 3

visitMethod · 0.80
builtin_hasFieldFunction · 0.80
builtin_fieldTypeFunction · 0.80

Calls 4

isPointerFunction · 0.85
findArgumentIndexMethod · 0.80
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected