#[non_exhaustive]pub struct Mode {
pub portable: bool,
}Expand description
Parsing mode derived from shell options
Some shell options change which syntax the parser accepts. This type conveys
the relevant option states from the shell environment to the parser and
lexer, so that the parser does not need to depend on the whole
OptionSet. The standard parser (yash-syntax)
reads it from the lexer and adjusts the syntax it accepts
accordingly.
A Mode is typically created from the current option set by converting an
OptionSet with the From implementation. The default mode
permits all syntax (every field is false), so the parser behaves as if no
restricting option were set.
This struct is #[non_exhaustive] because more fields may be added as more
parsing-affecting options are supported. You can still create one by starting
from Default or a converted OptionSet and assigning to individual
fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.portable: boolWhether the parser rejects non-portable syntax
This reflects the Portable shell option. When true, the parser
reports an error on constructs that are valid in yash but not portable
across POSIX-conforming shells.
Trait Implementations§
impl Copy for Mode
impl Eq for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
impl Freeze for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnsafeUnpin for Mode
impl UnwindSafe for Mode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more