internal/cache

Cache for atto parsers, splitters and regexes so that we don’t need to create them for every use.

Types

pub type Cache {
  Cache(
    atx_heading_empty: regexp.Regexp,
    atx_heading_tail: regexp.Regexp,
    setext_h1: regexp.Regexp,
    setext_h2: regexp.Regexp,
    open_tag: regexp.Regexp,
    close_tag: regexp.Regexp,
    p_blank: atto.Parser(Nil, String, String, Nil, String),
    p_hr: atto.Parser(Bool, String, String, Nil, String),
    p_atx_heading: atto.Parser(
      #(Int, atto.Pos),
      String,
      String,
      Nil,
      String,
    ),
    p_bullet_list_item: fn(String) -> atto.Parser(
      Bool,
      String,
      String,
      Nil,
      String,
    ),
    p_ordered_list_item: fn(String) -> atto.Parser(
      Bool,
      String,
      String,
      Nil,
      String,
    ),
    p_fence: atto.Parser(
      #(String, option.Option(String)),
      String,
      String,
      Nil,
      String,
    ),
    p_end_fence: fn(Int, String) -> atto.Parser(
      String,
      String,
      String,
      Nil,
      String,
    ),
    p_blockquote: atto.Parser(String, String, String, Nil, String),
    is_html_block_start: fn(String, Bool) -> Bool,
    is_paragraph_continuation_text: fn(String) -> Bool,
    starts_with_ws: fn(String) -> Bool,
    ends_with_ws: fn(String) -> Bool,
    starts_with_p: fn(String) -> Bool,
    ends_with_p: fn(String) -> Bool,
    html_1_start: regexp.Regexp,
    html_1_end: regexp.Regexp,
    html_2_start: regexp.Regexp,
  )
}

Constructors

Values

pub fn new() -> Cache
Search Document