Struct SaveOptions
pub struct SaveOptions {
pub parser: &'static str,
pub lexer_type: String,
pub ambiguity: &'static str,
pub priority: Option<&'static str>,
pub keep_all_tokens: bool,
pub maybe_placeholders: bool,
pub ordered_sets: bool,
pub use_bytes: bool,
pub g_regex_flags: u32,
pub translate_python_regex: bool,
pub propagate_positions: bool,
pub start: Vec<String>,
}Expand description
The scalar, compile-invariant options that populate data.options. The
callable/hook options (transformer, postlex, lexer_callbacks,
edit_terminals) are deliberately absent — they are re-supplied at load
(Lark’s _LOAD_ALLOWED_OPTIONS) and cannot cross a portable JSON boundary; the
Python binding layers them into a pickle envelope wrapping this JSON.
Fields§
§parser: &'static str"lalr" — the only parser save supports (non-LALR is rejected by Lark).
lexer_type: StringThe resolved lexer name (Lark round-trips the resolved value, not auto).
ambiguity: &'static str"auto" / "resolve" / "explicit" (Lark serializes Resolve as auto).
priority: Option<&'static str>"auto" / "normal" / "invert", or None for Lark’s priority=None.
keep_all_tokens: bool§maybe_placeholders: bool§ordered_sets: bool§use_bytes: bool§g_regex_flags: u32§translate_python_regex: boolWhether the terminals are read in Python’s re dialect. Rides the wire
beside g_regex_flags for the same reason: it decides what the saved
patterns MEAN, and a load that guessed it would compile a different
language from the one that was saved.
propagate_positions: bool§start: Vec<String>