Lines Matching defs:lines
51 function __construct($lines) {
52 $this->orig = $lines;
64 function __construct($lines) {
65 $this->closing = $lines;
136 // Skip leading common lines.
142 // Skip trailing common lines.
151 // Ignore lines which do not exist in both files.
225 * This function assumes that the first lines of the specified portions
226 * of the two files do not match, and likewise that the last lines do not
227 * match. The caller must trim matching lines from the beginning and end
340 * All line numbers are origin-0 and discarded lines are not counted.
391 * Adjust inserts/deletes of identical lines to join changes
394 * We do something when a run of changed lines include a
403 * @param array $lines
407 function _shift_boundaries($lines, &$changed, $other_changed) {
411 USE_ASSERTS && assert(count($lines) == count($changed));
412 $len = count($lines);
423 * (unchanged lines).
459 while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) {
484 while ($i < $len && $lines[$start] == $lines[$i]) {
528 * (Typically these are lines from a file.)
587 * Get the original set of lines.
595 $lines = array();
599 array_splice($lines, count($lines), 0, $edit->orig);
601 return $lines;
605 * Get the closing set of lines.
613 $lines = array();
617 array_splice($lines, count($lines), 0, $edit->closing);
619 return $lines;
668 * (Typically these are lines from a file.)
715 * Number of leading context "lines" to preserve.
723 * Number of trailing context "lines" to preserve.
849 function _lines($lines, $prefix = ' ') {
850 foreach ($lines as $line)
854 function _context($lines) {
855 $this->_lines($lines);
858 function _added($lines) {
859 $this->_lines($lines, ">");
861 function _deleted($lines) {
862 $this->_lines($lines, "<");
1013 function _split($lines) {
1015 implode("\n", $lines), $m)) {
1055 function _split($lines) {
1057 implode("\n", $lines), $m)) {
1104 function _added($lines) {
1105 $this->_lines($lines, "+");
1107 function _deleted($lines) {
1108 $this->_lines($lines, "-");
1163 function _lines($lines, $prefix=' ', $color="white") {
1191 function _added($lines) {
1192 $this->_addedLines($lines,false);
1195 function _addedLines($lines,$escaped=false){
1196 foreach ($lines as $line) {
1201 function _deleted($lines) {
1202 foreach ($lines as $line) {
1207 function _context($lines) {
1208 foreach ($lines as $line) {
1280 function _lines($lines, $prefix=' ', $color="white") {
1283 function _added($lines) {
1284 foreach ($lines as $line) {
1289 function _deleted($lines) {
1290 foreach ($lines as $line) {
1295 function _context($lines) {
1296 foreach ($lines as $line) {
1331 * @param array $orig The original lines to use.
1343 * Returns the merged lines
1348 * @return array lines of the merged text
1351 $lines = array();
1355 $lines = array_merge($lines,
1363 $lines = array_merge($lines, $edit->merged());
1367 return $lines;
1501 function __construct($lines = false) {
1502 $this->orig = $lines ? $lines : array();
1527 function input($lines) {
1528 if ($lines) {
1529 $this->_append($this->orig, $lines);
1533 function out1($lines) {
1534 if ($lines) {
1535 $this->_append($this->final1, $lines);
1539 function out2($lines) {
1540 if ($lines) {
1541 $this->_append($this->final2, $lines);
1563 function _append(&$array, $lines) {
1564 array_splice($array, sizeof($array), 0, $lines);