MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / nextLine

Method nextLine

other_src/astyle/src/ASFormatter.cpp:369–1247  ·  view source on GitHub ↗

* get the next formatted line. * * @return formatted line. */

Source from the content-addressed store, hash-verified

367 * @return formatted line.
368 */
369string ASFormatter::nextLine()
370{
371 const string* newHeader;
372 bool isInVirginLine = isVirgin;
373 isCharImmediatelyPostComment = false;
374 isPreviousCharPostComment = false;
375 isCharImmediatelyPostLineComment = false;
376 isCharImmediatelyPostOpenBlock = false;
377 isCharImmediatelyPostCloseBlock = false;
378 isCharImmediatelyPostTemplate = false;
379 traceLineNumber++;
380
381 while (!isLineReady)
382 {
383 if (shouldReparseCurrentChar)
384 shouldReparseCurrentChar = false;
385 else if (!getNextChar())
386 {
387 breakLine();
388 continue;
389 }
390 else // stuff to do when reading a new character...
391 {
392 // make sure that a virgin '{' at the begining of the file will be treated as a block...
393 if (isInVirginLine && currentChar == '{'
394 && currentLineBeginsWithBracket // lineBeginsWith('{')
395 && previousCommandChar == ' ')
396 previousCommandChar = '{';
397 if (isInHorstmannRunIn)
398 isInLineBreak = false;
399 if (!isWhiteSpace(currentChar))
400 isInHorstmannRunIn = false;
401 isPreviousCharPostComment = isCharImmediatelyPostComment;
402 isCharImmediatelyPostComment = false;
403 isCharImmediatelyPostTemplate = false;
404 isCharImmediatelyPostReturn = false;
405 isCharImmediatelyPostOperator = false;
406 isCharImmediatelyPostPointerOrReference = false;
407 isCharImmediatelyPostOpenBlock = false;
408 isCharImmediatelyPostCloseBlock = false;
409 }
410
411// if (inLineNumber >= 7)
412// int x = 1;
413
414 if (shouldBreakLineAtNextChar && !isWhiteSpace(currentChar))
415 {
416 isInLineBreak = true;
417 shouldBreakLineAtNextChar = false;
418 }
419
420 if (isInExecSQL && !passedSemicolon)
421 {
422 if (currentChar == ';')
423 passedSemicolon = true;
424 appendCurrentChar();
425 continue;
426 }

Callers 1

getNextLineMethod · 0.45

Calls 11

c_strMethod · 0.80
enhanceMethod · 0.80
lengthMethod · 0.45
backMethod · 0.45
appendMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected