fn key_name(&mut self) -> Option<String> {
        let start = self.next_pos();
        let key = if self.eat('"') {
            self.finish_basic_string(start, false)
        } else if self.eat('\'') {
            self.finish_literal_string(start, false)
        } else {
            let mut ret = String::new();
            while let Some((_, ch)) = self.cur.clone().next() {
                match ch {
                    'a' ... 'z' |
                    'A' ... 'Z' |
                    '0' ... '9' |
                    '_' | '-' => { self.cur.next(); ret.push(ch) }
                    _ => break,
                }
            }
            Some(ret)
        };
        match key {
            Some(ref name) if name.is_empty() => {
                self.errors.push(ParserError {
                    lo: start,
                    hi: start,
                    desc: format!("expected a key but found an empty string"),
                });
                None
            }
            Some(name) => Some(name),
            None => None,
        }
    }
// Parse a single key name starting at `start`
Parse a single key name starting at `start`
Parse a single key name starting at ` start `
fn key_name(&mut self) -> Option<String> {
        let start = self.next_pos();
        let key = if self.eat('"') {
            self.finish_basic_string(start, false)
        } else if self.eat('\'') {
            self.finish_literal_string(start, false)
        } else {
            let mut ret = String::new();
            while let Some((_, ch)) = self.cur.clone().next() {
                match ch {
                    'a' ... 'z' |
                    'A' ... 'Z' |
                    '0' ... '9' |
                    '_' | '-' => { self.cur.next(); ret.push(ch) }
                    _ => break,
                }
            }
            Some(ret)
        };
        match key {
            Some(ref name) if name.is_empty() => {
                self.errors.push(ParserError {
                    lo: start,
                    hi: start,
                    desc: format!("expected a key but found an empty string"),
                });
                None
            }
            Some(name) => Some(name),
            None => None,
        }
    }
fn key_name ( & mut self ) -> Option < String > { let start = self . next_pos ( ) ; let key = if self . eat ( '"' ) { self . finish_basic_string ( start , false ) } else if self . eat ( '\'' ) { self . finish_literal_string ( start , false ) } else { let mut ret = String :: new ( ) ; while let Some ( ( _ , ch ) ) = self . cur . clone ( ) . next ( ) { match ch { 'a' ... 'z' | 'A' ... 'Z' | '0' ... '9' | '_' | '-' => { self . cur . next ( ) ; ret . push ( ch ) } _ => break , } } Some ( ret ) } ; match key { Some ( ref name ) if name . is_empty ( ) => { self . errors . push ( ParserError { lo : start , hi : start , desc : format ! ( " " ) , } ) ; None } Some ( name ) => Some ( name ) , None => None , } }
Parse a single key name starting at `start`
Parse a single key name starting at ` start `
&mut self
&mut self