fn lex_character(l: &mut Lexer) -> Option<StateFn> {
    // check for one of the many special character names
    if l.folding {
        l.accept_run("abcdeiklmnoprstuwABCDEIKLMNOPRSTUW");
    } else {
        l.accept_run("abcdeiklmnoprstuw");
    }
    let folding = l.folding;
    if l.token_matches("#\\newline", folding)
        || l.token_matches("#\\space", folding)
        || l.token_matches("#\\alarm", folding)
        || l.token_matches("#\\backspace", folding)
        || l.token_matches("#\\delete", folding)
        || l.token_matches("#\\escape", folding)
        || l.token_matches("#\\null", folding)
        || l.token_matches("#\\return", folding)
        || l.token_matches("#\\tab", folding)
    {
        l.emit_folded(TokenType::Character);
    } else {
        // ensure we read at least one character
        if l.token_length() < 3 && l.next() == None {
            return errorf(l, "reached EOF in character literal");
        }
        // ensure the next token is a delimiter
        if let Some(ch) = l.peek() {
            if !is_delimiter(ch) {
                l.next();
                return errorf(l, "invalid character literal");
            }
        }
        l.emit(TokenType::Character);
    }
    Some(StateFn(lex_start))
}
/// `lex_character` processes a character literal.
`lex_character` processes a character literal.
` lex_character ` processes a character literal .
fn lex_character(l: &mut Lexer) -> Option<StateFn> {
    // check for one of the many special character names
    if l.folding {
        l.accept_run("abcdeiklmnoprstuwABCDEIKLMNOPRSTUW");
    } else {
        l.accept_run("abcdeiklmnoprstuw");
    }
    let folding = l.folding;
    if l.token_matches("#\\newline", folding)
        || l.token_matches("#\\space", folding)
        || l.token_matches("#\\alarm", folding)
        || l.token_matches("#\\backspace", folding)
        || l.token_matches("#\\delete", folding)
        || l.token_matches("#\\escape", folding)
        || l.token_matches("#\\null", folding)
        || l.token_matches("#\\return", folding)
        || l.token_matches("#\\tab", folding)
    {
        l.emit_folded(TokenType::Character);
    } else {
        // ensure we read at least one character
        if l.token_length() < 3 && l.next() == None {
            return errorf(l, "reached EOF in character literal");
        }
        // ensure the next token is a delimiter
        if let Some(ch) = l.peek() {
            if !is_delimiter(ch) {
                l.next();
                return errorf(l, "invalid character literal");
            }
        }
        l.emit(TokenType::Character);
    }
    Some(StateFn(lex_start))
}
fn lex_character ( l : & mut Lexer ) -> Option < StateFn > { // check for one of the many special character names if l . folding { l . accept_run ( " " ) ; } else { l . accept_run ( " " ) ; } let folding = l . folding ; if l . token_matches ( " \\ " , folding ) || l . token_matches ( " \\ " , folding ) || l . token_matches ( " \\ " , folding ) || l . token_matches ( " \\ " , folding ) || l . token_matches ( " \\ " , folding ) || l . token_matches ( " \\ " , folding ) || l . token_matches ( " \\ " , folding ) || l . token_matches ( " \\ " , folding ) || l . token_matches ( " \\ " , folding ) { l . emit_folded ( TokenType :: Character ) ; } else { // ensure we read at least one character if l . token_length ( ) < 3 && l . next ( ) == None { return errorf ( l , " " ) ; } // ensure the next token is a delimiter if let Some ( ch ) = l . peek ( ) { if ! is_delimiter ( ch ) { l . next ( ) ; return errorf ( l , " " ) ; } } l . emit ( TokenType :: Character ) ; } Some ( StateFn ( lex_start ) ) }
`lex_character` processes a character literal.
` lex_character ` processes a character literal .
l
&mut Lexer