span

fun span(start: Int = 0, end: Int = 0, ctxt: Int = 0, block: Span.() -> Unit = {}): Span

Create a Span object with specified start, end, and context values.

A Span represents a location in the source code. It's used throughout the AST to track where each node appears in the original source.

This is a Kotlin extension function. For Java, use Spans.create instead.

Return

Configured Span object

Parameters

start

Starting byte position in the source code

end

Ending byte position in the source code

ctxt

Syntax context (used for macro expansion tracking)

block

Optional lambda to further configure the span