| 1119 | } |
| 1120 | |
| 1121 | int 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 | |
| 1152 | int asCBuilder::VerifyProperty(asCDataType *dt, const char *decl, asCString &name, asCDataType &type, asSNameSpace *ns) |
| 1153 | { |
nothing calls this directly
no test coverage detected