toon_codec/decode/scanner

Line scanner and cursor for TOON decoding.

This module provides functions to scan input text into parsed lines with depth information, and a cursor type for traversing those lines. Scan input into a list of parsed lines with depth information.

Each line is analyzed for indentation, depth is calculated, and blank lines are tracked.

Arguments

Types

pub opaque type LineCursor

Values

pub fn cursor_advance(cursor: LineCursor) -> LineCursor
pub fn cursor_at_end(cursor: LineCursor) -> Bool
pub fn cursor_length(cursor: LineCursor) -> Int
pub fn cursor_new(lines: List(types.ParsedLine)) -> LineCursor
pub fn cursor_peek_ahead(
  cursor: LineCursor,
  offset: Int,
) -> option.Option(types.ParsedLine)
pub fn cursor_position(cursor: LineCursor) -> Int
pub fn cursor_remaining_lines(
  cursor: LineCursor,
) -> List(types.ParsedLine)
pub fn scan_lines(
  input: String,
  indent_size: Int,
  strict: Bool,
) -> Result(List(types.ParsedLine), error.ToonError)
Search Document