ScalusSourcePos

scalus.utils.ScalusSourcePos
See theScalusSourcePos companion object
case class ScalusSourcePos(file: String, startLine: Int, startColumn: Int, endLine: Int, endColumn: Int, inlinedFrom: List[ScalusSourcePos] = ...)

Source position in Scala code, used by both SIR and UPLC Term for tracing.

Value parameters

endColumn

0-based end column

endLine

0-based end line

file

file path. Empty string means position is unknown.

inlinedFrom

chain of positions from which this was inlined

startColumn

0-based start column

startLine

0-based start line

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

The position to attribute a node to, preferring real provenance over a synthetic label.

The position to attribute a node to, preferring real provenance over a synthetic label.

  • a real position resolves to itself (so genuine library/user lines keep their own attribution — no "blame the caller" flip);
  • the synthetic compile-boundary root resolves to the outermost real entry of its inline chain (inlinedFrom, whose last element is the original user compile(...) call) — real compile-time provenance rather than a guess from tree structure;
  • if neither is available it stays ScalusSourcePos.empty, leaving the position-fill to fall back to the nearest positioned neighbour.

Attributes

def isEffectivelyEmpty: Boolean

True when this position carries no useful attribution: either genuinely unknown (isEmpty) or the synthetic compile-boundary root (ScalusSourcePos.syntheticMarkerFile), which is compiler glue rather than user code. The post-optimization position-fill uses this so the program root never wins as a fallback location — generated spine is attributed to the nearest real user code instead of pooling in one fake hot-spot.

True when this position carries no useful attribution: either genuinely unknown (isEmpty) or the synthetic compile-boundary root (ScalusSourcePos.syntheticMarkerFile), which is compiler glue rather than user code. The post-optimization position-fill uses this so the program root never wins as a fallback location — generated spine is attributed to the nearest real user code instead of pooling in one fake hot-spot.

Attributes

def isEmpty: Boolean
def show: String
def showSingle: String

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product