fix: GetTokenName

This commit is contained in:
msojocs 2023-06-16 22:02:58 +08:00
parent a2eb9101f8
commit b7deccb9bb
2 changed files with 12 additions and 7 deletions

View File

@ -424,12 +424,19 @@ namespace WXML
class Token class Token
{ {
/**
*
* 00 00 00 00 type
* 00 00 00 00... 0tokenName
*/
private: private:
/* data */ /* data */
int type;
std::string tokenName;
public: public:
Token(/* args */); Token(/* args */);
~Token(); ~Token();
static const char * GetTokenName(const char **a1); const char * GetTokenName();
}; };

View File

@ -12,15 +12,13 @@ namespace WXML
Token::~Token() Token::~Token()
{ {
} }
const char * Token::GetTokenName(const char **a1) const char * Token::GetTokenName()
{ {
const char *result; // eax const char *result;
switch ( this->type )
result = *a1;
switch ( (unsigned int)*a1 )
{ {
case 0u: case 0u:
result = (const char *)(a1 + 1); result = this->tokenName.c_str();
break; break;
case 1u: case 1u:
result = "$DECIMAL"; result = "$DECIMAL";