caffeine_lang/phase_1/parser/utils/glaml_helpers

Values

pub fn extract_bool_from_node(
  node: glaml.Node,
  key: String,
) -> Result(Bool, String)

Extracts a boolean from a glaml node

pub fn extract_dict_strings_from_node(
  node: glaml.Node,
  key: String,
) -> Result(dict.Dict(String, String), String)

Extracts a dictionary of string key-value pairs from a glaml node.

pub fn extract_float_from_node(
  node: glaml.Node,
  key: String,
) -> Result(Float, String)

Extracts a float from a glaml node.

pub fn extract_int_from_node(
  node: glaml.Node,
  key: String,
) -> Result(Int, String)

Extracts an integer from a glaml node.

pub fn extract_string_from_node(
  node: glaml.Node,
  key: String,
) -> Result(String, String)

Extracts a string from a glaml node.

pub fn extract_string_list_from_node(
  node: glaml.Node,
  key: String,
) -> Result(List(String), String)

Extracts a list of strings from a glaml node.

pub fn parse_specification(
  file_path: String,
  params: dict.Dict(String, String),
  parse_fn: fn(glaml.Node, dict.Dict(String, String)) -> Result(
    a,
    String,
  ),
  key: String,
) -> Result(List(a), String)

Parses a specification file into a list of glaml documents according to the given parse function.

Search Document