pub struct ShellProfile {
pub dialect: ShellDialect,
pub options: Option<ZshOptionState>,
}Expand description
Complete shell parsing profile.
A profile combines the broad syntax dialect with any option state that
changes tokenization or grammar. Today only zsh carries parser-visible
options; non-zsh profiles ignore the ShellProfile::options field.
Fields§
§dialect: ShellDialectShell dialect to parse.
options: Option<ZshOptionState>Optional zsh option state, used only when ShellProfile::dialect is
ShellDialect::Zsh.
Implementations§
Source§impl ShellProfile
impl ShellProfile
Sourcepub fn native(dialect: ShellDialect) -> Self
pub fn native(dialect: ShellDialect) -> Self
Build the parser’s native profile for dialect.
Native zsh profiles include ZshOptionState::zsh_default. Other
dialects carry no option state.
Sourcepub fn with_zsh_options(dialect: ShellDialect, options: ZshOptionState) -> Self
pub fn with_zsh_options(dialect: ShellDialect, options: ZshOptionState) -> Self
Build a profile with explicit zsh option state.
The provided options are retained only for ShellDialect::Zsh. For
other dialects, this returns a profile with options: None because
their parser behavior is not currently option-sensitive.
Sourcepub fn zsh_options(&self) -> Option<&ZshOptionState>
pub fn zsh_options(&self) -> Option<&ZshOptionState>
Borrow the zsh option state, if this profile carries one.
Callers should treat None as “no parser-visible zsh option state”,
not as “all options are unknown”.
Trait Implementations§
Source§impl Clone for ShellProfile
impl Clone for ShellProfile
Source§fn clone(&self) -> ShellProfile
fn clone(&self) -> ShellProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ShellProfile
impl Debug for ShellProfile
Source§impl Hash for ShellProfile
impl Hash for ShellProfile
Source§impl PartialEq for ShellProfile
impl PartialEq for ShellProfile
Source§fn eq(&self, other: &ShellProfile) -> bool
fn eq(&self, other: &ShellProfile) -> bool
self and other values to be equal, and is used by ==.