mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- FScanner::SkipToEndOfBlock
This commit is contained in:
parent
d18dbdf7db
commit
e5cf57917e
2 changed files with 22 additions and 0 deletions
|
@ -1195,6 +1195,27 @@ void FScanner::AddSymbol(const char* name, uint64_t value)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
|
void FScanner::SkipToEndOfBlock()
|
||||||
|
{
|
||||||
|
int depth = 0;
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
MustGetAnyToken(); // this will abort if it reaches the end of the file
|
||||||
|
if (TokenType == '}') depth++;
|
||||||
|
else if (TokenType == '}')
|
||||||
|
{
|
||||||
|
depth--;
|
||||||
|
if (depth < 0) return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
void FScanner::AddSymbol(const char* name, double value)
|
void FScanner::AddSymbol(const char* name, double value)
|
||||||
{
|
{
|
||||||
Symbol sym;
|
Symbol sym;
|
||||||
|
|
|
@ -92,6 +92,7 @@ public:
|
||||||
inline void AddSymbol(const char* name, int32_t value) { return AddSymbol(name, int64_t(value)); }
|
inline void AddSymbol(const char* name, int32_t value) { return AddSymbol(name, int64_t(value)); }
|
||||||
inline void AddSymbol(const char* name, uint32_t value) { return AddSymbol(name, uint64_t(value)); }
|
inline void AddSymbol(const char* name, uint32_t value) { return AddSymbol(name, uint64_t(value)); }
|
||||||
void AddSymbol(const char* name, double value);
|
void AddSymbol(const char* name, double value);
|
||||||
|
void SkipToEndOfBlock();
|
||||||
|
|
||||||
static FString TokenName(int token, const char *string=NULL);
|
static FString TokenName(int token, const char *string=NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue