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

Method isArrayOperator

astyle/src/ASFormatter.cpp:6384–6413  ·  view source on GitHub ↗

Check following data to determine if the current character is an array operator.

Source from the content-addressed store, hash-verified

6382
6383// Check following data to determine if the current character is an array operator.
6384bool ASFormatter::isArrayOperator() const
6385{
6386 assert(currentChar == '*' || currentChar == '&' || currentChar == '^');
6387 assert(isBracketType(bracketTypeStack->back(), ARRAY_TYPE));
6388
6389 // find next word
6390 size_t nextNum = currentLine.find_first_not_of(" \t", charNum + 1);
6391 if (nextNum == string::npos)
6392 return NULL;
6393
6394 if (!isLegalNameChar(currentLine[nextNum]))
6395 return NULL;
6396
6397 // bypass next word and following spaces
6398 while (nextNum < currentLine.length())
6399 {
6400 if (!isLegalNameChar(currentLine[nextNum])
6401 && !isWhiteSpace(currentLine[nextNum]))
6402 break;
6403 nextNum++;
6404 }
6405
6406 // check for characters that indicate an operator
6407 if (currentLine[nextNum] == ','
6408 || currentLine[nextNum] == '}'
6409 || currentLine[nextNum] == ')'
6410 || currentLine[nextNum] == '(')
6411 return true;
6412 return false;
6413}
6414
6415// Reset the flags that indicate various statement information.
6416void ASFormatter::resetEndOfStatement()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected