package coffee.liz.lambda.ast; import lombok.NonNull; /** * A comment with its source location; inline vs leading direction. * * @param text * the comment text content * @param span * the source location of the comment */ public record SourceComment(@NonNull String text, @NonNull SourceSpan span) { /** * Returns true if this comment is on the same line as the given span's end. */ public boolean isInlineAfter(final SourceSpan previous) { return previous != null && previous.endLine() == this.span.startLine(); } }