Fix parse embed with hex skip or size setting

This commit is contained in:
drmortalwombat 2024-02-19 14:19:15 +01:00
parent 5e9df61ffc
commit e2f36bbb9a
2 changed files with 9 additions and 2 deletions

View File

@ -470,6 +470,11 @@ void Scanner::MarkSourceOnce(void)
mOnceDict->Insert(macro); mOnceDict->Insert(macro);
} }
bool Scanner::IsIntegerToken(void) const
{
return mToken == TK_INTEGER || mToken == TK_INTEGERU || mToken == TK_INTEGERL || mToken == TK_INTEGERUL;
}
void Scanner::NextToken(void) void Scanner::NextToken(void)
{ {
if (mReplay) if (mReplay)
@ -885,12 +890,12 @@ void Scanner::NextPreToken(void)
mCompilerOptions &= ~COPT_PETSCII; mCompilerOptions &= ~COPT_PETSCII;
NextRawToken(); NextRawToken();
if (mToken == TK_INTEGER) if (IsIntegerToken())
{ {
limit = int(mTokenInteger); limit = int(mTokenInteger);
NextRawToken(); NextRawToken();
if (mToken == TK_INTEGER) if (IsIntegerToken())
{ {
skip = int(mTokenInteger); skip = int(mTokenInteger);
NextRawToken(); NextRawToken();

View File

@ -275,6 +275,8 @@ public:
uint64 mCompilerOptions; uint64 mCompilerOptions;
bool IsIntegerToken(void) const;
void AddMacro(const Ident* ident, const char* value); void AddMacro(const Ident* ident, const char* value);
void MarkSourceOnce(void); void MarkSourceOnce(void);
protected: protected: