Refactoring the code for the templates handling
This commit is contained in:
parent
128215d692
commit
9fe8ae452a
|
@ -535,20 +535,23 @@ void Tokenizer::tokenize(std::istream &code, const char FileName[])
|
||||||
int indentlevel = 0;
|
int indentlevel = 0;
|
||||||
for (; tok3; tok3 = tok3->next())
|
for (; tok3; tok3 = tok3->next())
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i <= type.size(); ++i)
|
|
||||||
{
|
{
|
||||||
if (i == type.size())
|
// search for this token in the type vector
|
||||||
{
|
unsigned int itype = 0;
|
||||||
if (tok3->str() == name)
|
while (itype < type.size() && type[itype] != tok3->str())
|
||||||
addtoken(name2.c_str(), tok3->linenr(), tok3->fileIndex());
|
++itype;
|
||||||
else
|
|
||||||
addtoken(tok3->str().c_str(), tok3->linenr(), tok3->fileIndex());
|
// replace type with given type..
|
||||||
}
|
if (itype < type.size())
|
||||||
else if (tok3->str() == type[i])
|
addtoken(types2[itype].c_str(), tok3->linenr(), tok3->fileIndex());
|
||||||
{
|
|
||||||
addtoken(types2[i].c_str(), tok3->linenr(), tok3->fileIndex());
|
// replace name..
|
||||||
break;
|
else if (tok3->str() == name)
|
||||||
}
|
addtoken(name2.c_str(), tok3->linenr(), tok3->fileIndex());
|
||||||
|
|
||||||
|
// copy
|
||||||
|
else
|
||||||
|
addtoken(tok3->str().c_str(), tok3->linenr(), tok3->fileIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tok3->str() == "{")
|
if (tok3->str() == "{")
|
||||||
|
|
Loading…
Reference in New Issue