Struct SavedOptions
pub struct SavedOptions {
pub parser: Option<String>,
pub lexer: Option<String>,
pub ambiguity: Option<String>,
pub priority: Option<Option<String>>,
pub keep_all_tokens: Option<bool>,
pub maybe_placeholders: Option<bool>,
pub ordered_sets: Option<bool>,
}Expand description
The compile-invariant half of a save’s data.options block — the options the
loader/compiler BAKED into the serialized rules and table, so a faithful load
must restore them from the file rather than re-accept them from the caller
(Lark’s _LOAD_ALLOWED_OPTIONS complement, lark.py:248 / :570-575).
Every field is Option: the block is absent from grammars written before it
was recorded (and from hand-authored loader fixtures), and an absent key
means “no opinion — keep the caller’s value”. Read by
read_saved_options; applied by Lark::from_json_str.
The runtime half (propagate_positions, g_regex_flags, use_bytes,
postlex, transformer, lexer_callbacks) is deliberately NOT here: those
are re-supplied at load by design.
Fields§
§parser: Option<String>"lalr" | "earley".
lexer: Option<String>"basic" | "contextual" | "dynamic" | "dynamic_complete" | "custom".
ambiguity: Option<String>"auto" | "resolve" | "explicit".
priority: Option<Option<String>>Tri-state: outer None = key absent, inner None = JSON null (Lark’s
priority=None, the strip mode), else "auto" | "normal" | "invert".
keep_all_tokens: Option<bool>§maybe_placeholders: Option<bool>The one that changes TREE SHAPE if lost: [...] optionals insert a
placeholder hole under true and nothing under false.
ordered_sets: Option<bool>Trait Implementations§
§impl Clone for SavedOptions
impl Clone for SavedOptions
§fn clone(&self) -> SavedOptions
fn clone(&self) -> SavedOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more