Crate sdml_parse
source ·Expand description
This library provides a parser for the Simple Domain Modeling Language (SDML) and produces an in-memory representation using the crate sdml-core.
The [ModuleLoader] trait from, sdml-core
, provides the interface for finding, parsing, and loading modules and the
load::ModuleLoader implementation is provided in this crate for file-system based module definitions.
§Example
The following example demonstrates the [ModuleLoader] to resolve a module name to a file and parse it.
use sdml_core::model::identifiers::Identifier;
use sdml_parse::load::ModuleLoader;
use std::str::FromStr;
let mut loader = ModuleLoader::default();
let name = Identifier::from_str("example").unwrap();
let module = loader.load(&name);
assert!(module.is_ok());
Modules§
- This crate provides the common resolver, loader, and parser errors.