CommonCheck: Moved 'IsName' and 'IsNumber' from main.cpp
This commit is contained in:
parent
997ae5f5b8
commit
909bf7e6cd
|
@ -19,3 +19,16 @@ void ReportErr(const std::string errmsg)
|
|||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
bool IsName(const char str[])
|
||||
{
|
||||
return (str[0]=='_' || std::isalpha(str[0]));
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
bool IsNumber(const char str[])
|
||||
{
|
||||
return std::isdigit(str[0]);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
|
|
@ -11,5 +11,9 @@ std::string FileLine(TOKEN *tok);
|
|||
|
||||
void ReportErr(const std::string errmsg);
|
||||
|
||||
|
||||
bool IsName(const char str[]);
|
||||
bool IsNumber(const char str[]);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue