finish engram-lang: protocols, decorators, imports, Result, closures, stdlib, integration tests

This commit is contained in:
Will Anderson
2026-04-27 20:22:23 -05:00
parent 316c0a85ce
commit c427a0adc0
32 changed files with 2878 additions and 32 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
//! version = "0.1.0"
//! edition = "2026"
//! "#;
//! let manifest = Manifest::from_str(toml).unwrap();
//! let manifest = Manifest::parse(toml).unwrap();
//! assert_eq!(manifest.package.name, "my-service");
//! ```
+2 -2
View File
@@ -342,14 +342,14 @@ pub struct Manifest {
impl Manifest {
/// Parse a manifest from a TOML string.
pub fn from_str(s: &str) -> crate::ManifestResult<Self> {
pub fn parse(s: &str) -> crate::ManifestResult<Self> {
crate::parse::parse_manifest(s)
}
/// Parse a manifest from a file on disk.
pub fn from_file(path: &std::path::Path) -> crate::ManifestResult<Self> {
let text = std::fs::read_to_string(path).map_err(crate::ManifestError::Io)?;
Self::from_str(&text)
Self::parse(&text)
}
/// Walk up the directory tree from `from` until an `el.toml` is found.