MCPcopy Create free account
hub / github.com/dirkvranckaert/AndroidDecompiler / getFollowingOperator

Method getFollowingOperator

astyle/src/ASFormatter.cpp:6355–6381  ·  view source on GitHub ↗

Check if an operator follows the next word. The next word must be a legal name.

Source from the content-addressed store, hash-verified

6353// Check if an operator follows the next word.
6354// The next word must be a legal name.
6355const string* ASFormatter::getFollowingOperator() const
6356{
6357 // find next word
6358 size_t nextNum = currentLine.find_first_not_of(" \t", charNum + 1);
6359 if (nextNum == string::npos)
6360 return NULL;
6361
6362 if (!isLegalNameChar(currentLine[nextNum]))
6363 return NULL;
6364
6365 // bypass next word and following spaces
6366 while (nextNum < currentLine.length())
6367 {
6368 if (!isLegalNameChar(currentLine[nextNum])
6369 && !isWhiteSpace(currentLine[nextNum]))
6370 break;
6371 nextNum++;
6372 }
6373
6374 if (nextNum >= currentLine.length()
6375 || !isCharPotentialOperator(currentLine[nextNum])
6376 || currentLine[nextNum] == '/') // comment
6377 return NULL;
6378
6379 const string* newOperator = ASBeautifier::findOperator(currentLine, nextNum, operators);
6380 return newOperator;
6381}
6382
6383// Check following data to determine if the current character is an array operator.
6384bool ASFormatter::isArrayOperator() const

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected