eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Diff::Data':



Class: Data (private in Diff

This class is only visible from within Diff.




Instance protocol:

o  bufferedLines

o  changedFlag

o  nondiscardedLines

o  realindexes

o  undiscarded

o  clear
Allocate changed array for the results of comparison.
Allocate a flag for each line of each file, saying whether that line
is an insertion or deletion. allocate an extra element, always zero,
at each end of each vector.

o  discard: discards felDiff: fellDiffClass
Actually discard the lines.
@param discards flags lines to be discarded

o  discardConfusingLines: f felDiff: felDiff
Discard lines that have no matches in another file.

A line which is discarded will not be considered by the actual
comparison algorithm; it will be as if that line were not in the file.
The file's `realindexes' table maps virtual line numbers
(which don't count the discarded lines) into real line numbers;
this is how the actual comparison algorithm produces results
that are comprehensible when the discarded lines are counted.

When we discard a line, we also mark it as a deletion or insertion
so that it will be printed in the output.
@param f the other file

o  discardable: counts
Mark to be discarded each line that matches no line of another file.
If a line matches many lines, mark it as provisionally discardable.
@see equivCount()
@param counts The count of each equivalence number for the other file.
@return 0=nondiscardable, 1=discardable or 2=provisionally discardable
for each line

o  equivCount: felDiff

o  fileData

o  fileData: data hashTable: h felDiff: fellDiffClass

o  filterDiscards: discards
Don't really discard the provisional lines except when they occur
in a run of discardables, with nonprovisionals at the beginning
and end.

o  shiftBoundaries: f
Adjust inserts/deletes of blank lines to join changes
as much as possible.
We do something when a run of changed lines include a blank
line at one end and have an excluded blank line at the other.
We are free to choose which blank line is included.
`compareseq' always chooses the one at the beginning,
but usually it is cleaner to consider the following blank line
to be the change. The only exception is if the preceding blank line
would join this change to other changes.
param f the file being compared against

ST/X; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Wed, 17 Aug 2022 23:07:16 GMT