fn lex_explicit_sign(l: &mut Lexer) -> Option<StateFn> {
    if let Some(ch) = l.peek() {
        if ch == 'i' || ch == 'I' || l.look_ahead("inf.0", true) || l.look_ahead("nan.0", true) {
            // these are ambiguous, but since 7.1.1 explicitly names
            // them as numbers, despite fitting the identifier pattern,
            // treat them as numbers
            l.rewind();
            return Some(StateFn(lex_number));
        }
        if is_sign_subsequent(ch) || is_delimiter(ch) {
            l.rewind();
            return Some(StateFn(lex_identifier));
        } else if ch == '.' {
            l.next();
            if let Some(ch) = l.peek() {
                if is_dot_subsequent(ch) {
                    l.rewind();
                    return Some(StateFn(lex_identifier));
                }
            } else {
                // if we ran out of tokens, it's an identifier
                l.rewind();
                return Some(StateFn(lex_identifier));
            }
        }
        // everything else must be a number
        l.rewind();
        return Some(StateFn(lex_number));
    }
    // if we ran out of tokens, it's an identifier
    l.rewind();
    Some(StateFn(lex_identifier))
}
/// `lex_explicit_sign` decides what should be done with the explicit sign
/// that the lexer just encountered (could be identifier or a number).
`lex_explicit_sign` decides what should be done with the explicit sign
that the lexer just encountered (could be identifier or a number).
` lex_explicit_sign ` decides what should be done with the explicit sign that the lexer just encountered ( could be identifier or a number ) .
fn lex_explicit_sign(l: &mut Lexer) -> Option<StateFn> {
    if let Some(ch) = l.peek() {
        if ch == 'i' || ch == 'I' || l.look_ahead("inf.0", true) || l.look_ahead("nan.0", true) {
            // these are ambiguous, but since 7.1.1 explicitly names
            // them as numbers, despite fitting the identifier pattern,
            // treat them as numbers
            l.rewind();
            return Some(StateFn(lex_number));
        }
        if is_sign_subsequent(ch) || is_delimiter(ch) {
            l.rewind();
            return Some(StateFn(lex_identifier));
        } else if ch == '.' {
            l.next();
            if let Some(ch) = l.peek() {
                if is_dot_subsequent(ch) {
                    l.rewind();
                    return Some(StateFn(lex_identifier));
                }
            } else {
                // if we ran out of tokens, it's an identifier
                l.rewind();
                return Some(StateFn(lex_identifier));
            }
        }
        // everything else must be a number
        l.rewind();
        return Some(StateFn(lex_number));
    }
    // if we ran out of tokens, it's an identifier
    l.rewind();
    Some(StateFn(lex_identifier))
}
fn lex_explicit_sign ( l : & mut Lexer ) -> Option < StateFn > { if let Some ( ch ) = l . peek ( ) { if ch == 'i' || ch == 'I' || l . look_ahead ( " " , true ) || l . look_ahead ( " " , true ) { // these are ambiguous, but since 7.1.1 explicitly names // them as numbers, despite fitting the identifier pattern, // treat them as numbers l . rewind ( ) ; return Some ( StateFn ( lex_number ) ) ; } if is_sign_subsequent ( ch ) || is_delimiter ( ch ) { l . rewind ( ) ; return Some ( StateFn ( lex_identifier ) ) ; } else if ch == '.' { l . next ( ) ; if let Some ( ch ) = l . peek ( ) { if is_dot_subsequent ( ch ) { l . rewind ( ) ; return Some ( StateFn ( lex_identifier ) ) ; } } else { // if we ran out of tokens, it's an identifier l . rewind ( ) ; return Some ( StateFn ( lex_identifier ) ) ; } } // everything else must be a number l . rewind ( ) ; return Some ( StateFn ( lex_number ) ) ; } // if we ran out of tokens, it's an identifier l . rewind ( ) ; Some ( StateFn ( lex_identifier ) ) }
`lex_explicit_sign` decides what should be done with the explicit sign
that the lexer just encountered (could be identifier or a number).
` lex_explicit_sign ` decides what should be done with the explicit sign that the lexer just encountered ( could be identifier or a number ) .
l
&mut Lexer