On this page:
Srcloc
Srcloc
Srcloc
Srcloc.source
Srcloc.line
Srcloc.column
Srcloc.position
Srcloc.span
Srcloc.to_  report_  string
8.15.0.12

7.9 Source Locations🔗ℹ

annotation

Srcloc

Matches a source location value.

function

fun Srcloc(source :: Any,

           line :: maybe(PosInt),

           column :: maybe(NonnegInt),

           position :: maybe(PosInt),

           span :: maybe(NonnegInt))

  :: Srcloc

Constructs a source location.

binding operator

Srcloc(source_bind,

       line_bind,

       column_bind,

       position_bind,

       span_bind)

Matches a source location where the components match the corresponding binding forms.

method

method (srcloc :: Srcloc).source() :: Any

 

method

method (srcloc :: Srcloc).line() :: maybe(PosInt)

 

method

method (srcloc :: Srcloc).column() :: maybe(NonnegInt)

 

method

method (srcloc :: Srcloc).position() :: maybe(PosInt)

 

method

method (srcloc :: Srcloc).span() :: maybe(NonnegInt)

Extracts a component of a source location.

method

method (srcloc :: Srcloc).to_report_string() :: String

Converts a source location into a human-readable string suitable for error messages and other reporting.

> Srcloc("demo.rhm", 1, 14, 500, 10).to_report_string()

"demo.rhm:1:14"