blob: 8e50f5fdeaa00a0a5ff02f90d3aadca92d07892e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
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();
}
}
|