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

Method getNextLine

other_src/astyle/src/ASFormatter.cpp:1683–1758  ·  view source on GitHub ↗

* get the next line of input, increasing the current placement in the process. * * @param sequence the sequence to append. * @return whether succeded in reading the next line. */

Source from the content-addressed store, hash-verified

1681 * @return whether succeded in reading the next line.
1682 */
1683bool ASFormatter::getNextLine(bool emptyLineWasDeleted /*false*/)
1684{
1685 if (sourceIterator->hasMoreLines())
1686 {
1687 if (appendOpeningBracket)
1688 currentLine = "{"; // append bracket that was removed from the previous line
1689 else
1690 {
1691 currentLine = sourceIterator->nextLine(emptyLineWasDeleted);
1692 assert(computeChecksumIn(currentLine));
1693 }
1694 // reset variables for new line
1695 inLineNumber++;
1696 isInCase = false;
1697 isInAsmOneLine = false;
1698 isInQuoteContinuation = isInVerbatimQuote | haveLineContinuationChar;
1699 haveLineContinuationChar= false;
1700 isImmediatelyPostEmptyLine = lineIsEmpty;
1701 previousChar = ' ';
1702
1703 if (currentLine.length() == 0)
1704 currentLine = string(" "); // a null is inserted if this is not done
1705
1706 // unless reading in the first line of the file, break a new line.
1707 if (!isVirgin)
1708 isInLineBreak = true;
1709 else
1710 isVirgin = false;
1711
1712 if (isImmediatelyPostNonInStmt)
1713 {
1714 isCharImmediatelyPostNonInStmt = true;
1715 isImmediatelyPostNonInStmt = false;
1716 }
1717
1718 // check if is in preprocessor before line trimming
1719 // a blank line after a \ will remove the flag
1720 isImmediatelyPostPreprocessor = isInPreprocessor;
1721 if (previousNonWSChar != '\\'
1722 || isEmptyLine(currentLine))
1723 isInPreprocessor = false;
1724
1725 if (passedSemicolon)
1726 isInExecSQL = false;
1727 initNewLine();
1728
1729 currentChar = currentLine[charNum];
1730 if (isInHorstmannRunIn && previousNonWSChar == '{' && !isInComment)
1731 isInLineBreak = false;
1732 isInHorstmannRunIn = false;
1733
1734 if (shouldConvertTabs && currentChar == '\t')
1735 convertTabToSpaces();
1736
1737 // check for an empty line inside a command bracket.
1738 // if yes then read the next line (calls getNextLine recursively).
1739 // must be after initNewLine.
1740 if (shouldDeleteEmptyLines

Callers

nothing calls this directly

Calls 4

hasMoreLinesMethod · 0.45
nextLineMethod · 0.45
lengthMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected