iotas 0.1.0

Iota Syntaxis 1.0 RC5 parser — the Unicode variant of Jot Syntax (https://iotasyntaxis.org)
Documentation
//! Iota Syntaxis parser — the Unicode variant of Jot Syntax
//! (<https://iotasyntaxis.org>).
//!
//! A thin shim over the [`jots`] crate with the variant preset:
//! identifier and filename character classes follow Unicode
//! `XID_Start`/`XID_Continue` instead of ASCII. Everything else —
//! wire format, `JOTS_*` env vars, `.jot.toml`, diagnostic codes —
//! is shared verbatim between the variants, so the two crates are
//! drop-in alternatives distinguished only by the default.
//!
//! The variant is runtime state on [`Config::unicode`]; this crate
//! exists so downstream users can depend on an explicitly
//! Iota-flavored surface without carrying the toggle themselves.

pub use jots::{Config, FlagValue, ParseResult};

pub const VERSION: &str = env!("CARGO_PKG_VERSION");

/// A [`jots::Config`] with the Iota Syntaxis variant preset.
pub fn config() -> Config {
    let mut cfg = Config::new();
    cfg.unicode = true;
    cfg
}

/// Load the standard config cascade (`~/.jot.toml` → `.jot.toml`
/// walk → `JOTS_*` env) with the Iota Syntaxis variant preset.
pub fn load() -> Config {
    let mut cfg = jots::config::load();
    cfg.unicode = true;
    cfg
}

/// Parse `text` as Iota Syntaxis. The variant is forced on
/// regardless of `cfg.unicode`; every other flag applies as-is.
pub fn parse(text: &str, cfg: &Config) -> ParseResult {
    let mut cfg = cfg.clone();
    cfg.unicode = true;
    jots::parse(text, &cfg)
}