caffeine_lang/parser/expectations

Types

pub type Expectation {
  Expectation(
    name: String,
    blueprint_ref: String,
    inputs: dict.Dict(String, dynamic.Dynamic),
  )
}

Constructors

Values

pub fn expectations_from_json(
  json_string: String,
  blueprints: List(blueprints.Blueprint),
) -> Result(List(Expectation), json.DecodeError)

Parse expectations from a JSON string. This is public so it can be used by browser.gleam for in-browser compilation.

pub fn parse_from_file(
  file_path: String,
  blueprints: List(blueprints.Blueprint),
) -> Result(
  List(semantic_analyzer.IntermediateRepresentation),
  errors.CompilationError,
)

Parse expectations from a file, leveraging the given file path for metadata extraction.

pub fn parse_from_string(
  json_string: String,
  file_path: String,
  blueprints: List(blueprints.Blueprint),
) -> Result(
  List(semantic_analyzer.IntermediateRepresentation),
  errors.CompilationError,
)

Parse expectations from a JSON string with a given path for metadata extraction. This is public so it can be used by browser.gleam for in-browser compilation. Furthermore, internally we use this as the base from which parse_from_file also uses to parse.

Search Document