Skip to main content

ZshOptionState

Struct ZshOptionState 

Source
pub struct ZshOptionState {
Show 27 fields pub sh_word_split: OptionValue, pub glob_subst: OptionValue, pub rc_expand_param: OptionValue, pub glob: OptionValue, pub nomatch: OptionValue, pub null_glob: OptionValue, pub csh_null_glob: OptionValue, pub extended_glob: OptionValue, pub ksh_glob: OptionValue, pub sh_glob: OptionValue, pub bare_glob_qual: OptionValue, pub glob_dots: OptionValue, pub equals: OptionValue, pub magic_equal_subst: OptionValue, pub sh_file_expansion: OptionValue, pub glob_assign: OptionValue, pub ignore_braces: OptionValue, pub ignore_close_braces: OptionValue, pub brace_ccl: OptionValue, pub ksh_arrays: OptionValue, pub ksh_zero_subscript: OptionValue, pub short_loops: OptionValue, pub short_repeat: OptionValue, pub rc_quotes: OptionValue, pub interactive_comments: OptionValue, pub c_bases: OptionValue, pub octal_zeroes: OptionValue,
}
Expand description

Snapshot of parser-visible zsh option state.

The fields here intentionally cover options that can change syntax, tokenization, or word interpretation. They are not a full zsh runtime option table. Use ZshOptionState::zsh_default for native zsh parsing, then apply setopt, unsetopt, or emulate effects when a caller has already discovered them.

Fields§

§sh_word_split: OptionValue

Whether unquoted parameter expansion is treated as eligible for shell-style word splitting.

§glob_subst: OptionValue

Whether parameter expansion results are treated as glob patterns.

§rc_expand_param: OptionValue

Whether array parameters can participate in brace-like expansion.

§glob: OptionValue

Whether ordinary filename generation is enabled.

§nomatch: OptionValue

Whether unmatched filename-generation patterns are treated as errors.

§null_glob: OptionValue

Whether unmatched filename-generation patterns can expand to nothing.

§csh_null_glob: OptionValue

Whether csh-style null glob handling is enabled.

§extended_glob: OptionValue

Whether zsh extended glob operators are enabled.

§ksh_glob: OptionValue

Whether ksh-style glob operators are enabled.

§sh_glob: OptionValue

Whether sh-compatible glob parsing is enabled.

§bare_glob_qual: OptionValue

Whether unparenthesized zsh glob qualifiers are enabled.

§glob_dots: OptionValue

Whether glob patterns match dotfiles without an explicit dot.

§equals: OptionValue

Whether leading = words are eligible for command-path expansion.

§magic_equal_subst: OptionValue

Whether assignment-like words can apply = expansion after the first equals sign.

§sh_file_expansion: OptionValue

Whether file expansion follows sh-compatible ordering.

§glob_assign: OptionValue

Whether assignment values can be parsed as glob assignments.

§ignore_braces: OptionValue

Whether brace characters should be treated literally instead of as zsh brace syntax.

§ignore_close_braces: OptionValue

Whether unmatched closing braces should be treated literally.

§brace_ccl: OptionValue

Whether character-class brace expansion syntax is enabled.

§ksh_arrays: OptionValue

Whether array indexing follows ksh-style zero-based behavior.

§ksh_zero_subscript: OptionValue

Whether subscript zero is accepted with ksh-style array semantics.

§short_loops: OptionValue

Whether zsh short loop forms are accepted.

§short_repeat: OptionValue

Whether zsh short repeat forms are accepted.

§rc_quotes: OptionValue

Whether doubled single quotes are decoded inside single-quoted strings.

§interactive_comments: OptionValue

Whether # starts comments in interactive-style zsh parsing contexts.

§c_bases: OptionValue

Whether C-style numeric base prefixes are accepted in arithmetic text.

§octal_zeroes: OptionValue

Whether leading zeroes are interpreted as octal arithmetic literals.

Implementations§

Source§

impl ZshOptionState

Source

pub const fn zsh_default() -> Self

Default zsh option state used for native zsh parsing.

This is the parser’s baseline before source-level commands such as emulate, setopt, and unsetopt are considered.

Source

pub fn for_emulate(mode: ZshEmulationMode) -> Self

Return the option state implied by emulate <mode>.

This models the subset of emulation effects that the parser currently needs. Callers can further refine the returned state with ZshOptionState::apply_setopt and ZshOptionState::apply_unsetopt.

Source

pub fn apply_setopt(&mut self, name: &str) -> bool

Apply a zsh setopt-style option name to this snapshot.

Names are matched with zsh-style aliases, underscores, and no_ prefixes where supported by this parser. Returns true when the option name was recognized and this snapshot was updated.

Source

pub fn apply_unsetopt(&mut self, name: &str) -> bool

Apply a zsh unsetopt-style option name to this snapshot.

Names are matched with zsh-style aliases, underscores, and no_ prefixes where supported by this parser. Returns true when the option name was recognized and this snapshot was updated.

Source

pub fn merge(&self, other: &Self) -> Self

Merge two option snapshots field by field.

Each field preserves a definite value only when both inputs agree. This is useful for conservative joins across control-flow paths.

Trait Implementations§

Source§

impl Clone for ZshOptionState

Source§

fn clone(&self) -> ZshOptionState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ZshOptionState

Source§

impl Debug for ZshOptionState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ZshOptionState

Source§

impl Hash for ZshOptionState

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ZshOptionState

Source§

fn eq(&self, other: &ZshOptionState) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ZshOptionState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.