neco_gleam/diagnostic

Types

pub type Failure {
  InvalidSpan(start_byte: Int, end_byte: Int)
}

Constructors

  • InvalidSpan(start_byte: Int, end_byte: Int)
pub type Message {
  Message(
    path: String,
    span: Span,
    severity: Severity,
    text: String,
  )
}

Constructors

  • Message(
      path: String,
      span: Span,
      severity: Severity,
      text: String,
    )
pub type Severity {
  Error
  Warning
  Information
}

Constructors

  • Error
  • Warning
  • Information

A half-open byte range whose endpoints are non-negative and ordered.

pub opaque type Span

Values

pub fn span_create(
  start_byte: Int,
  end_byte: Int,
) -> Result(Span, Failure)

Creates [start_byte, end_byte), returning InvalidSpan for a negative endpoint or a start greater than the end.

pub fn span_end_byte(span: Span) -> Int
pub fn span_start_byte(span: Span) -> Int
pub fn span_zero() -> Span

Returns the empty span [0, 0).

Search Document