MCPcopy Create free account
hub / github.com/anjo76/angelscript / ParseTemplateDecl

Method ParseTemplateDecl

sdk/angelscript/source/as_builder.cpp:1121–1150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1119}
1120
1121int asCBuilder::ParseTemplateDecl(const char *decl, asCString *name, asCArray<asCString> &subtypeNames)
1122{
1123 Reset();
1124
1125 asCScriptCode source;
1126 source.SetCode("", decl, true);
1127
1128 asCParser parser(this);
1129 int r = parser.ParseTemplateDecl(&source);
1130 if( r < 0 )
1131 return asINVALID_TYPE;
1132
1133 // Get the template name and subtype names
1134 asCScriptNode *node = parser.GetScriptNode()->firstChild;
1135
1136 name->Assign(&decl[node->tokenPos], node->tokenLength);
1137 while( (node = node->next) != 0 )
1138 {
1139 asCString subtypeName;
1140 subtypeName.Assign(&decl[node->tokenPos], node->tokenLength);
1141 subtypeNames.PushLast(subtypeName);
1142 }
1143
1144 // TODO: template: check for name conflicts
1145
1146 if( numErrors > 0 )
1147 return asINVALID_DECLARATION;
1148
1149 return asSUCCESS;
1150}
1151
1152int asCBuilder::VerifyProperty(asCDataType *dt, const char *decl, asCString &name, asCDataType &type, asSNameSpace *ns)
1153{

Callers

nothing calls this directly

Calls 4

SetCodeMethod · 0.80
GetScriptNodeMethod · 0.80
AssignMethod · 0.80
PushLastMethod · 0.80

Tested by

no test coverage detected