pub fn parse(&mut self) -> Option<super::Table> {
        let mut ret = TomlTable { values: BTreeMap::new(), defined: false };
        self.bom();
        while self.peek(0).is_some() {
            self.ws();
            if self.newline() { continue }
            if self.comment() { continue }
            if self.eat('[') {
                let array = self.eat('[');
                let start = self.next_pos();

                // Parse the name of the section
                let mut keys = Vec::new();
                loop {
                    self.ws();
                    if let Some(s) = self.key_name() {
                        keys.push(s);
                    }
                    self.ws();
                    if self.eat(']') {
                        if array && !self.expect(']') { return None }
                        break
                    }
                    if !self.expect('.') { return None }
                }
                if keys.is_empty() { return None }

                // Build the section table
                let mut table = TomlTable {
                    values: BTreeMap::new(),
                    defined: true,
                };
                if self.require_newline_after_table {
                    self.ws();
                    if !self.comment() && !self.newline() {
                        self.errors.push(ParserError {
                            lo: start,
                            hi: start,
                            desc: format!("expected a newline after table definition"),
                        });
                        return None
                    }
                }
                if !self.values(&mut table) { return None }
                if array {
                    self.insert_array(&mut ret, &keys, Value::Table(table),
                                      start)
                } else {
                    self.insert_table(&mut ret, &keys, table, start)
                }
            } else {
                if !self.values(&mut ret) { return None }
            }
        }
        if !self.errors.is_empty() {
            None
        } else {
            Some(ret.convert())
        }
    }
/// Executes the parser, parsing the string contained within.
///
/// This function will return the `TomlTable` instance if parsing is
/// successful, or it will return `None` if any parse error or invalid TOML
/// error occurs.
///
/// If an error occurs, the `errors` field of this parser can be consulted
/// to determine the cause of the parse failure.
Executes the parser, parsing the string contained within.
This function will return the `TomlTable` instance if parsing is
successful, or it will return `None` if any parse error or invalid TOML
error occurs.

If an error occurs, the `errors` field of this parser can be consulted
to determine the cause of the parse failure.
Executes the parser parsing the string contained within . This function will return the ` TomlTable ` instance if parsing is successful or it will return ` None ` if any parse error or invalid TOML error occurs . If an error occurs the ` errors ` field of this parser can be consulted to determine the cause of the parse failure .
pub fn parse(&mut self) -> Option<super::Table> {
        let mut ret = TomlTable { values: BTreeMap::new(), defined: false };
        self.bom();
        while self.peek(0).is_some() {
            self.ws();
            if self.newline() { continue }
            if self.comment() { continue }
            if self.eat('[') {
                let array = self.eat('[');
                let start = self.next_pos();
                // Parse the name of the section
                let mut keys = Vec::new();
                loop {
                    self.ws();
                    if let Some(s) = self.key_name() {
                        keys.push(s);
                    }
                    self.ws();
                    if self.eat(']') {
                        if array && !self.expect(']') { return None }
                        break
                    }
                    if !self.expect('.') { return None }
                }
                if keys.is_empty() { return None }
                // Build the section table
                let mut table = TomlTable {
                    values: BTreeMap::new(),
                    defined: true,
                };
                if self.require_newline_after_table {
                    self.ws();
                    if !self.comment() && !self.newline() {
                        self.errors.push(ParserError {
                            lo: start,
                            hi: start,
                            desc: format!("expected a newline after table definition"),
                        });
                        return None
                    }
                }
                if !self.values(&mut table) { return None }
                if array {
                    self.insert_array(&mut ret, &keys, Value::Table(table),
                                      start)
                } else {
                    self.insert_table(&mut ret, &keys, table, start)
                }
            } else {
                if !self.values(&mut ret) { return None }
            }
        }
        if !self.errors.is_empty() {
            None
        } else {
            Some(ret.convert())
        }
    }
pub fn parse ( & mut self ) -> Option < super :: Table > { let mut ret = TomlTable { values : BTreeMap :: new ( ) , defined : false } ; self . bom ( ) ; while self . peek ( 0 ) . is_some ( ) { self . ws ( ) ; if self . newline ( ) { continue } if self . comment ( ) { continue } if self . eat ( '[' ) { let array = self . eat ( '[' ) ; let start = self . next_pos ( ) ; // Parse the name of the section let mut keys = Vec :: new ( ) ; loop { self . ws ( ) ; if let Some ( s ) = self . key_name ( ) { keys . push ( s ) ; } self . ws ( ) ; if self . eat ( ']' ) { if array && ! self . expect ( ']' ) { return None } break } if ! self . expect ( '.' ) { return None } } if keys . is_empty ( ) { return None } // Build the section table let mut table = TomlTable { values : BTreeMap :: new ( ) , defined : true , } ; if self . require_newline_after_table { self . ws ( ) ; if ! self . comment ( ) && ! self . newline ( ) { self . errors . push ( ParserError { lo : start , hi : start , desc : format ! ( " " ) , } ) ; return None } } if ! self . values ( & mut table ) { return None } if array { self . insert_array ( & mut ret , & keys , Value :: Table ( table ) , start ) } else { self . insert_table ( & mut ret , & keys , table , start ) } } else { if ! self . values ( & mut ret ) { return None } } } if ! self . errors . is_empty ( ) { None } else { Some ( ret . convert ( ) ) } }
Executes the parser, parsing the string contained within.
Executes the parser parsing the string contained within .
&mut self
&mut self