package coffee.liz.lambda.ast; /** * Span of source code with start and end positions. * * @param startLine * 1-based line number where the span starts * @param startColumn * 1-based column number where the span starts * @param endLine * 1-based line number where the span ends * @param endColumn * 1-based column number where the span ends */ public record SourceSpan(int startLine, int startColumn, int endLine, int endColumn) { public static final SourceSpan UNKNOWN = new SourceSpan(0, 0, 0, 0); /** * Returns true if this span ends on the same line that the other span starts. */ public boolean isOnSameLine(final SourceSpan other) { return this.endLine == other.startLine; } }