MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / advanceToken

Method advanceToken

Engine/source/core/tokenizer.cpp:267–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267bool Tokenizer::advanceToken(const bool crossLine, const bool assertAvail)
268{
269 if (mTokenIsCurrent == true)
270 {
271 AssertFatal(mCurrTokenBuffer[0] != '\0', "No token, but marked as current?");
272 mTokenIsCurrent = false;
273 return true;
274 }
275
276 U32 currPosition = 0;
277 mCurrTokenBuffer[0] = '\0';
278
279 mTokenIsQuoted = false;
280
281 // Store the beginning of the previous advance
282 // and the beginning of the current advance
283 mStartPos = mCurrPos;
284
285 while (mCurrPos < mBufferSize)
286 {
287 char c = mpBuffer[mCurrPos];
288
289 bool cont = true;
290
291 if (mSingleTokens && dStrchr(mSingleTokens, c))
292 {
293 if (currPosition == 0)
294 {
295 mCurrTokenBuffer[currPosition++] = c;
296 mCurrPos++;
297 cont = false;
298 break;
299 }
300 else
301 {
302 // End of token
303 cont = false;
304 }
305 }
306 else
307 {
308 switch (c)
309 {
310 case ' ':
311 case '\t':
312 if (currPosition == 0)
313 {
314 // Token hasn't started yet...
315 mCurrPos++;
316 }
317 else
318 {
319 // End of token
320 mCurrPos++;
321 cont = false;
322 }
323 break;
324

Callers 2

parseObjectMethod · 0.80
parseFileMethod · 0.80

Calls 2

avarFunction · 0.85
dStrchrFunction · 0.50

Tested by

no test coverage detected