fn lex_pipe_identifier(l: &mut Lexer) -> Option<StateFn> {
    let mut ident = String::new();
    ident.push('|');
    // form |identifier| allows nearly anything
    while let Some(ch) = l.next() {
        if ch == '\\' {
            if let Some(ch) = l.next() {
                match ch {
                    // \ is only permitted before specific characters
                    '|' => ident.push('|'),
                    'a' => ident.push('\x07'),
                    'b' => ident.push('\x08'),
                    't' => ident.push('\t'),
                    'n' => ident.push('\n'),
                    'r' => ident.push('\r'),
                    'x' => {
                        ident.push('\\');
                        ident.push(ch);
                    }
                    // everything else is wrong
                    _ => {
                        return errorf(l, "expected x|a|b|t|n|r after \\ in escape sequence");
                    }
                }
            } else {
                return errorf(l, "reached EOF in |identifier| expression");
            }
        } else if ch == '|' {
            ident.push(ch);
            match replace_escapes(&ident[..]) {
                Ok(escaped) => {
                    l.emit_identifier(&escaped[..]);
                    return Some(StateFn(lex_start));
                }
                Err(msg) => {
                    return errorf(l, msg);
                }
            }
        } else {
            ident.push(ch);
        }
    }
    errorf(l, "reached EOF in |identifier| expression")
}
/// `lex_pipe_identifier` expects the first character to be a vertical
/// bar (|) and scans the text until it finds an unescaped vertical bar.
/// The text inbetween may contain inline hex escapes and mnemonic escapes.
`lex_pipe_identifier` expects the first character to be a vertical
bar (|) and scans the text until it finds an unescaped vertical bar.
The text inbetween may contain inline hex escapes and mnemonic escapes.
` lex_pipe_identifier ` expects the first character to be a vertical bar ( | ) and scans the text until it finds an unescaped vertical bar . The text inbetween may contain inline hex escapes and mnemonic escapes .
fn lex_pipe_identifier(l: &mut Lexer) -> Option<StateFn> {
    let mut ident = String::new();
    ident.push('|');
    // form |identifier| allows nearly anything
    while let Some(ch) = l.next() {
        if ch == '\\' {
            if let Some(ch) = l.next() {
                match ch {
                    // \ is only permitted before specific characters
                    '|' => ident.push('|'),
                    'a' => ident.push('\x07'),
                    'b' => ident.push('\x08'),
                    't' => ident.push('\t'),
                    'n' => ident.push('\n'),
                    'r' => ident.push('\r'),
                    'x' => {
                        ident.push('\\');
                        ident.push(ch);
                    }
                    // everything else is wrong
                    _ => {
                        return errorf(l, "expected x|a|b|t|n|r after \\ in escape sequence");
                    }
                }
            } else {
                return errorf(l, "reached EOF in |identifier| expression");
            }
        } else if ch == '|' {
            ident.push(ch);
            match replace_escapes(&ident[..]) {
                Ok(escaped) => {
                    l.emit_identifier(&escaped[..]);
                    return Some(StateFn(lex_start));
                }
                Err(msg) => {
                    return errorf(l, msg);
                }
            }
        } else {
            ident.push(ch);
        }
    }
    errorf(l, "reached EOF in |identifier| expression")
}
fn lex_pipe_identifier ( l : & mut Lexer ) -> Option < StateFn > { let mut ident = String :: new ( ) ; ident . push ( '|' ) ; // form |identifier| allows nearly anything while let Some ( ch ) = l . next ( ) { if ch == '\\' { if let Some ( ch ) = l . next ( ) { match ch { // \ is only permitted before specific characters '|' => ident . push ( '|' ) , 'a' => ident . push ( '\x07' ) , 'b' => ident . push ( '\x08' ) , 't' => ident . push ( '\t' ) , 'n' => ident . push ( '\n' ) , 'r' => ident . push ( '\r' ) , 'x' => { ident . push ( '\\' ) ; ident . push ( ch ) ; } // everything else is wrong _ => { return errorf ( l , " \\ " ) ; } } } else { return errorf ( l , " " ) ; } } else if ch == '|' { ident . push ( ch ) ; match replace_escapes ( & ident [ .. ] ) { Ok ( escaped ) => { l . emit_identifier ( & escaped [ .. ] ) ; return Some ( StateFn ( lex_start ) ) ; } Err ( msg ) => { return errorf ( l , msg ) ; } } } else { ident . push ( ch ) ; } } errorf ( l , " " ) }
`lex_pipe_identifier` expects the first character to be a vertical
bar (|) and scans the text until it finds an unescaped vertical bar.
` lex_pipe_identifier ` expects the first character to be a vertical bar ( | ) and scans the text until it finds an unescaped vertical bar .
l
&mut Lexer