fn take_while<T>(
        &self,
        remaining: &mut RemainingIter!(),
        wrap: impl Fn(&str) -> T,
        pred: impl Fn(char) -> bool,
    ) -> (T, usize) {
        let mut len = 0;
        while let Some(n) = remaining.peek() {
            if !pred(*n) {
                break;
            }
            len += n.len_utf8();
            remaining.next();
        }
        let inside = &self.grab_from_index(len);
        (wrap(inside), len)
    }
Starting at the parser's current index.
consumes characters one at a time according to a
`pred`icate. after the predicate returns false,
the string is passed to a `wrap` function, which
converts the string slice of consumed characters
into a type `T`, and returns that type along
with the number of bytes consumed. (The number
of bytes consumed can be used to advance
`self.index`.)
passerine/src/compiler/lex.rs