ppoppo-sigil-parser 0.20.0

Parser for the ppoppo `@@/` chat sigil grammar — entity references, verbs, scopes, modifiers
Documentation
//! **NOT a stable public API.** Engine-tier `@@/` sigil-grammar parser —
//! published so an independent-posture client (CCC, RFC_202607180403) can
//! consume it from crates.io, and so the ppoppo clients (CCC + CWC) share ONE
//! grammar source. The `@@/` grammar co-evolves with the chat surface; do not
//! build a 3rd-party integration on this crate's API expecting stability.

#![deny(rust_2018_idioms)]
#![warn(missing_debug_implementations)]

mod parse;
mod types;

pub use parse::parse;
pub use types::{
    Modifier, NamedRef, ParseError, Scope, ScopeRef, SigilCommand, SigilRef, Verb,
};

/// The trigger prefix for sigil commands.
pub const TRIGGER: &str = "@@/";

/// Returns `true` if the input starts with the sigil trigger `@@/`.
pub fn is_sigil(input: &str) -> bool {
    input.starts_with(TRIGGER)
}

/// The `@@/man` help catalogue as raw JSON — the packaged `fixtures/help.json`.
/// Exposed so clients render `@@/man` from the crate itself instead of reaching
/// into this crate's source tree by relative path (the fixture ships inside the
/// published artifact). Shape: `{ "verbs": { <verb>: { summary, usage,
/// description, examples[] } }, "error_usage": <str> }`. Parse with the client's
/// own `serde_json` — deliberately kept out of this crate's runtime API.
pub const HELP_JSON: &str = include_str!("../fixtures/help.json");