fn lex_start(l: &mut Lexer) -> Option<StateFn> {
    if let Some(ch) = l.next() {
        match ch {
            '(' => {
                l.emit(TokenType::OpenParen);
                Some(StateFn(lex_start))
            }
            ')' => {
                l.emit(TokenType::CloseParen);
                Some(StateFn(lex_start))
            }
            '"' => Some(StateFn(lex_string)),
            ' ' | '\t' | '\r' | '\n' => Some(StateFn(lex_separator)),
            ';' => Some(StateFn(lex_comment)),
            '#' => Some(StateFn(lex_hash)),
            '[' | ']' | '{' | '}' => errorf(l, "use of reserved character"),
            '\'' | '`' => Some(StateFn(lex_quote)),
            ',' => Some(StateFn(lex_unquote)),
            '0'..='9' => {
                l.rewind();
                Some(StateFn(lex_number))
            }
            '+' | '-' => Some(StateFn(lex_explicit_sign)),
            '.' => Some(StateFn(lex_dot)),
            '@' => errorf(l, "@ cannot be the start of a token"),
            '\\' => errorf(l, "\\ cannot be the start of a token"),
            '|' => Some(StateFn(lex_pipe_identifier)),
            _ => {
                // almost certainly an identifier
                l.rewind();
                Some(StateFn(lex_identifier))
            }
        }
    } else {
        l.emit(TokenType::EndOfFile);
        None
    }
}
/// `lex_start` reads the next token from the input and determines what
/// to do with that token, returning the appropriate state function.
`lex_start` reads the next token from the input and determines what
to do with that token, returning the appropriate state function.
` lex_start ` reads the next token from the input and determines what to do with that token returning the appropriate state function .
fn lex_start(l: &mut Lexer) -> Option<StateFn> {
    if let Some(ch) = l.next() {
        match ch {
            '(' => {
                l.emit(TokenType::OpenParen);
                Some(StateFn(lex_start))
            }
            ')' => {
                l.emit(TokenType::CloseParen);
                Some(StateFn(lex_start))
            }
            '"' => Some(StateFn(lex_string)),
            ' ' | '\t' | '\r' | '\n' => Some(StateFn(lex_separator)),
            ';' => Some(StateFn(lex_comment)),
            '#' => Some(StateFn(lex_hash)),
            '[' | ']' | '{' | '}' => errorf(l, "use of reserved character"),
            '\'' | '`' => Some(StateFn(lex_quote)),
            ',' => Some(StateFn(lex_unquote)),
            '0'..='9' => {
                l.rewind();
                Some(StateFn(lex_number))
            }
            '+' | '-' => Some(StateFn(lex_explicit_sign)),
            '.' => Some(StateFn(lex_dot)),
            '@' => errorf(l, "@ cannot be the start of a token"),
            '\\' => errorf(l, "\\ cannot be the start of a token"),
            '|' => Some(StateFn(lex_pipe_identifier)),
            _ => {
                // almost certainly an identifier
                l.rewind();
                Some(StateFn(lex_identifier))
            }
        }
    } else {
        l.emit(TokenType::EndOfFile);
        None
    }
}
fn lex_start ( l : & mut Lexer ) -> Option < StateFn > { if let Some ( ch ) = l . next ( ) { match ch { '(' => { l . emit ( TokenType :: OpenParen ) ; Some ( StateFn ( lex_start ) ) } ')' => { l . emit ( TokenType :: CloseParen ) ; Some ( StateFn ( lex_start ) ) } '"' => Some ( StateFn ( lex_string ) ) , ' ' | '\t' | '\r' | '\n' => Some ( StateFn ( lex_separator ) ) , ';' => Some ( StateFn ( lex_comment ) ) , '#' => Some ( StateFn ( lex_hash ) ) , '[' | ']' | '{' | '}' => errorf ( l , " " ) , '\'' | '`' => Some ( StateFn ( lex_quote ) ) , ',' => Some ( StateFn ( lex_unquote ) ) , '0' ..= '9' => { l . rewind ( ) ; Some ( StateFn ( lex_number ) ) } '+' | '-' => Some ( StateFn ( lex_explicit_sign ) ) , '.' => Some ( StateFn ( lex_dot ) ) , '@' => errorf ( l , " " ) , '\\' => errorf ( l , " \\ " ) , '|' => Some ( StateFn ( lex_pipe_identifier ) ) , _ => { // almost certainly an identifier l . rewind ( ) ; Some ( StateFn ( lex_identifier ) ) } } } else { l . emit ( TokenType :: EndOfFile ) ; None } }
`lex_start` reads the next token from the input and determines what
to do with that token, returning the appropriate state function.
` lex_start ` reads the next token from the input and determines what to do with that token returning the appropriate state function .
l
&mut Lexer