pub struct Lexstop;Expand description
Port of int lexstop (declared Src/lex.c:175, extern in zsh.h) —
used by ihgetc/histsubchar/herrflush/ihungetc.
C has exactly ONE lexstop. zshrs splits it into two halves that are
reset in pairs (see the paired-global notes at lex.rs:493-500 and
input.rs:993-996):
input::lexstop— the input-side gate,Src/input.c:322if (lexstop) return ' ';lex::LEX_LEXSTOP— the lexer-side gate ongettok.
hist.rs used to own a THIRD, private AtomicBool copy that nothing
outside this file ever read. That made ihgetc’s bad-!-expansion
stop (Src/hist.c:434 lexstop = 1;) a write into a dead variable:
the hgetc bridge at lex.rs:5069 kept seeing input::lexstop == false, accepted the ' ' that Src/hist.c:436 returns as a real
character, and on the next refill fell through to inputline()
(Src/input.c:354) — so an interactive print -r -- "a!b" printed
event not found: b and then sat at a dquote> PS2 continuation
instead of discarding the line and reprompting PS1.
This zero-sized handle keeps the C spelling (lexstop.load(…) /
lexstop.store(…, …)) at every call site while addressing the real
pair: reads take the input-side half (every lexstop read in this
file asks “is input exhausted?”), writes set both, exactly as C’s
single assignment does.
Implementations§
Auto Trait Implementations§
impl Freeze for Lexstop
impl RefUnwindSafe for Lexstop
impl Send for Lexstop
impl Sync for Lexstop
impl Unpin for Lexstop
impl UnsafeUnpin for Lexstop
impl UnwindSafe for Lexstop
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