Skip to main content

input_unread_since

Function input_unread_since 

Source
pub fn input_unread_since(mark: &InputMark) -> bool
Expand description

Whether none of the input mark held has been read since it was taken (input_mark): its mouth is still open, has read no further, and its pushback still holds every token it held then (only what was pushed after the mark was read, or what a mouth opened since holds). Read-only, for an observer telling apart what a call’s expansion did from what the input after the call did (the frontmatter observer’s ledger, the title-page check’s document calls). The mouth’s watch tells how short its pushback has been since the mark (PushbackWatch): no shorter than the mark’s length, nothing it held was read; shorter by at most MARK_HELD tokens, those read were put back if the slots hold the very tokens they held (same_token: a peek leaves the input unread); shorter still, it was read. Tokens read below the mark and others pushed in their place read as read, though the token now at the mark’s last slot equals the one it held — IEEEtran’s \IEEEauthorblockN{…}⏎\IEEEauthorblockA{…}, whose line-end space was read with \IEEEauthorblockA and its argument and whose expansion, longer, put another space there: its affiliation calls read as the author block’s own and were lost by the frontmatter emitter (2401.11731, 1801.03314). No token is copied but the held ones: a mark costs at most one run of the watch, a test a binary search of its runs.