public bool IsEqualish()

in src/SourcemapToolkit.SourcemapParser/SourcePosition.cs [70:92]


		public bool IsEqualish(SourcePosition other)
		{
			// If the column numbers differ by 1, we can say that the source code is approximately equal
			if (this.ZeroBasedLineNumber == other.ZeroBasedLineNumber && Math.Abs(this.ZeroBasedColumnNumber - other.ZeroBasedColumnNumber) <= 1)
			{
				return true;
			}

			// This handles the case where we are comparing code at the end of one line and the beginning of the next line.
			// If the column number on one of the entries is zero, it is ok for the line numbers to differ by 1, so long as the one that has a column number of zero is the one with the larger line number.
			// Since we don't have the number of columns in each line, we can't know for sure if these two pieces of code are actually near each other. This is an optimistic guess.
			if (Math.Abs(this.ZeroBasedLineNumber - other.ZeroBasedLineNumber) == 1)
			{
				SourcePosition largerLineNumber = this.ZeroBasedLineNumber > other.ZeroBasedLineNumber ? this : other;

				if (largerLineNumber.ZeroBasedColumnNumber == 0)
				{
					return true;
				}
			}

			return false;
		}