pub enum SubscriptBound {
Search(i64, bool),
Math(String),
}Expand description
!!! WARNING: RUST-ONLY HELPER !!!
Classification of ONE subscript operand — a range bound (${a[lo,hi]})
or a chained subscript (${a[lo,hi][SUB]}) — whose text may open with a
(...) flag group.
C has no such function: getarg (c:Src/params.c:1367) parses the flags,
runs the search and returns the index all in one pass, writing its
side-effects back through Value *v / int *inv out-parameters. zshrs’s
ported::params::getarg returns the matched ELEMENT for r/R and the
INDEX for i/I (see getarg_out), and it has no Value to record
v->isarr |= SCANPM_WANTVALS in — so the two facts every bound consumer
needs (the match POSITION and whether WANTVALS was raised) are recovered
here in one place instead of being re-derived at each call site.
Variants§
Search(i64, bool)
c:Src/params.c:1729-1760 — the flag group ran a pattern SEARCH.
.0 is getarg’s 1-based match index r (c:1758 returns 0 for a
REVERSE miss, c:1751 len + 1 for a FORWARD miss); .1 records
c:1523 v->isarr |= SCANPM_WANTVALS, raised by r/R/k/K
when the i/I index flag (ind) is off.
Math(String)
c:Src/params.c:1597 r = mathevalarg(s, &s) — no search ran; the
payload is the text to evaluate as arithmetic. A recognised but
non-search flag group ((s.X.), (w), …) has been stripped; an
UNKNOWN group is left in place because c:1477-1483’s flagerr arm
rewinds to before the ( and re-reads the whole group as math.
Auto Trait Implementations§
impl Freeze for SubscriptBound
impl RefUnwindSafe for SubscriptBound
impl Send for SubscriptBound
impl Sync for SubscriptBound
impl Unpin for SubscriptBound
impl UnsafeUnpin for SubscriptBound
impl UnwindSafe for SubscriptBound
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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