src/HumdrumFileBase.cpp
HLp HumdrumFileBase::getLineForInterpretationInsertion(int index) {
	HumdrumFileBase& infile = *this;
	int current = index - 1;
	int previous = index;
	while (current > 0) {
		if (!infile[current].hasSpines()) {
			current--;
			continue;
		}
		if (infile[current].isCommentLocal()) {
			previous = current;
			current--;
			continue;
		}
		return &infile[previous];
	}
	return &infile[index];
}
//////////////////////////////
//
// HumdrumFileBase::getLineForInterpretationInsertion --  Search backwards
//    in the file for the first local comment immediately before a data line
//    index given as input.  If there are no local comments, then return the
//    data line.  If there are local comment lines immediately before the data
//    line, then keep searching for the first local comment.  Non-spined lines
//    (global or empty lines) are ignored.  This function is used to insert
//    an empty interpretation before a data line at a specific data line.
//
:getLineForInterpretationInsertion --  Search backwards
in the file for the first local comment immediately before a data line
index given as input.  If there are no local comments, then return the
data line.  If there are local comment lines immediately before the data
line, then keep searching for the first local comment.  Non-spined lines
(global or empty lines) are ignored.  This function is used to insert
an empty interpretation before a data line at a specific data line.
: getLineForInterpretationInsertion -- Search backwards in the file for the first local comment immediately before a data line index given as input . If there are no local comments then return the data line . If there are local comment lines immediately before the data line then keep searching for the first local comment . Non - spined lines ( global or empty lines ) are ignored . This function is used to insert an empty interpretation before a data line at a specific data line .
HLp HumdrumFileBase::getLineForInterpretationInsertion(int index) {
	HumdrumFileBase& infile = *this;
	int current = index - 1;
	int previous = index;
	while (current > 0) {
		if (!infile[current].hasSpines()) {
			current--;
			continue;
		}
		if (infile[current].isCommentLocal()) {
			previous = current;
			current--;
			continue;
		}
		return &infile[previous];
	}
	return &infile[index];
}
HLp HumdrumFileBase :: getLineForInterpretationInsertion ( int index ) { HumdrumFileBase & infile = * this ; int current = index - 1 ; int previous = index ; while ( current > 0 ) { if ( ! infile [ current ] . hasSpines ( ) ) { current -- ; continue ; } if ( infile [ current ] . isCommentLocal ( ) ) { previous = current ; current -- ; continue ; } return & infile [ previous ] ; } return & infile [ index ] ; }
HumdrumFileBase::getLineForInterpretationInsertion --  Search backwards
in the file for the first local comment immediately before a data line
index given as input.
HumdrumFileBase :: getLineForInterpretationInsertion -- Search backwards in the file for the first local comment immediately before a data line index given as input .