private void addSeparatorIncludingRegion_Forwards( ArrayList<StructureSkipSuggestion> regions, StructureSkipSuggestion aRegion) { if (isSeparatorStartingLine(aRegion.getIndexHistoryEnd())) { IndentInfo startSkip = IndentInfo.cloneIndentInfo(aRegion.getStartSkip()); IndentInfo endSkip = IndentInfo.cloneIndentInfo(aRegion.getEndSkip()); int indentShift = separatorIndent(aRegion.getIndexHistoryEnd()) - endSkip.getIndentValue(); endSkip.setTokensSeen(endSkip.getTokensSeen() + indentShift); StructureSkipSuggestion previousRegion3 = new StructureSkipSuggestion(); previousRegion3.setSkipLocations( startSkip, endSkip, aRegion.getIndexHistoryStart(), aRegion.getIndexHistoryEnd()); regions.add(previousRegion3); } }
private int skipLine(int indexLine) { IndentInfo line = getHistory().getLine(indexLine); IndentationHandler skipIndentHandler = new IndentationHandler(); getHistory().setTokenIndex(Math.max(0, line.getTokensSeen() - 1)); skipIndentHandler.setInLeftMargin(false); getHistory().readRecoverToken(myParser, false); while (myParser.currentToken != SGLR.EOF) { getHistory().readRecoverToken(myParser, false); skipIndentHandler.updateIndentation(myParser.currentToken); if (skipIndentHandler.lineMarginEnded()) { return indexLine += 1; } } return getHistory().getIndexLastLine(); // EOF }
private String readLine(IndentInfo line) { int startTok = line.getTokensSeen(); String lineContent = getHistory().readLine(startTok, myParser.currentInputStream); return lineContent; }