Refactoring : Removed the function 'findtoken'
This commit is contained in:
parent
e0e84d53ac
commit
0a73591c5c
21
token.cpp
21
token.cpp
|
@ -318,27 +318,6 @@ const TOKEN *TOKEN::findmatch(const TOKEN *tok, const char pattern[], const char
|
|||
return 0;
|
||||
}
|
||||
|
||||
const TOKEN *TOKEN::findtoken(const TOKEN *tok1, const char *tokenstr[])
|
||||
{
|
||||
for (const TOKEN *ret = tok1; ret; ret = ret->next())
|
||||
{
|
||||
unsigned int i = 0;
|
||||
const TOKEN *tok = ret;
|
||||
while (tokenstr[i])
|
||||
{
|
||||
if (!tok)
|
||||
return NULL;
|
||||
if (*(tokenstr[i]) && (tokenstr[i] != tok->_str))
|
||||
break;
|
||||
tok = tok->next();
|
||||
i++;
|
||||
}
|
||||
if (!tokenstr[i])
|
||||
return ret;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned int TOKEN::varId() const
|
||||
{
|
||||
return _varId;
|
||||
|
|
1
token.h
1
token.h
|
@ -98,7 +98,6 @@ public:
|
|||
bool isNumber() const;
|
||||
bool isStandardType() const;
|
||||
static const TOKEN *findmatch(const TOKEN *tok, const char pattern[], const char *varname1[]=0, const char *varname2[]=0);
|
||||
static const TOKEN *findtoken(const TOKEN *tok1, const char *tokenstr[]);
|
||||
|
||||
/**
|
||||
* Needle is build from multiple alternatives. If one of
|
||||
|
|
Loading…
Reference in New Issue