Skip to main content

parse_multilinear_extended

Function parse_multilinear_extended 

Source
pub fn parse_multilinear_extended(
    input_path: &Path,
    aspects_path: Option<&Path>,
) -> Result<NamedMultilinearInfo, ExtendedError>
Expand description

Parses a multilinear system from a directory or file, with optional aspect initialization.

This is a convenience function that creates a parser, optionally loads aspect defaults via parse_aspect_defaults, and then processes the input path via parse_directory_or_file.

§Arguments

  • input_path - Path to a .mld file or directory to parse
  • aspects_path - Optional path to an aspects file defining initial conditions Each line should be in the format aspect_name:default_value.

§Returns

Returns the fully parsed NamedMultilinearInfo on success.

§Errors

Returns ExtendedError variants for file system errors, parsing errors, or invalid aspect definitions.

§Example

use std::path::Path;
use multilinear_parser::parse_multilinear_extended;

// Parse a directory tree with custom aspect default values
let story = parse_multilinear_extended(
    "story/chapters/".as_ref(),
    Some("story/aspects.mla".as_ref())
).unwrap();

// Or parse a single file without aspects
let story = parse_multilinear_extended(
    "story.mld".as_ref(),
    None
).unwrap();