mirror of
https://github.com/msojocs/wx-compiler.git
synced 2025-07-19 00:00:04 +08:00
fix: GetTokenName
This commit is contained in:
parent
a2eb9101f8
commit
b7deccb9bb
@ -424,12 +424,19 @@ namespace WXML
|
||||
|
||||
class Token
|
||||
{
|
||||
/**
|
||||
* 内存结构:
|
||||
* 00 00 00 00 标识type
|
||||
* 00 00 00 00... 当标识为0时后面为需要的动态字符串tokenName
|
||||
*/
|
||||
private:
|
||||
/* data */
|
||||
int type;
|
||||
std::string tokenName;
|
||||
public:
|
||||
Token(/* args */);
|
||||
~Token();
|
||||
static const char * GetTokenName(const char **a1);
|
||||
const char * GetTokenName();
|
||||
};
|
||||
|
||||
|
||||
|
@ -12,15 +12,13 @@ namespace WXML
|
||||
Token::~Token()
|
||||
{
|
||||
}
|
||||
const char * Token::GetTokenName(const char **a1)
|
||||
const char * Token::GetTokenName()
|
||||
{
|
||||
const char *result; // eax
|
||||
|
||||
result = *a1;
|
||||
switch ( (unsigned int)*a1 )
|
||||
const char *result;
|
||||
switch ( this->type )
|
||||
{
|
||||
case 0u:
|
||||
result = (const char *)(a1 + 1);
|
||||
result = this->tokenName.c_str();
|
||||
break;
|
||||
case 1u:
|
||||
result = "$DECIMAL";
|
||||
|
Loading…
x
Reference in New Issue
Block a user