fn parse_value(&mut self) -> Result<Option<Value>, SyntaxError> {
        if self.within_tag {
            self.within_tag = false;
            return self.parse_tag();
        }
        let mut s = String::new();
        while let Some(c) = self.next_char()? {
            if c == '[' {
                if let Some('[') = self.peek_char() {
                    self.next_char()?;
                } else if s.is_empty() {
                    return self.parse_tag();
                } else {
                    self.within_tag = true;
                    break;
                }
            } else if c == ']' {
                if let Some(']') = self.peek_char() {
                    self.next_char()?;
                } else {
                    return Err(SyntaxError::UnsupportedTag(s));
                }
            }
            s.push(c);
        }
        if s.is_empty() {
            Ok(None)
        } else {
            Ok(Some(Value::Text(s)))
        }
    }
/// Parse a value at the current position.
Parse a value at the current position.
Parse a value at the current position .
fn parse_value(&mut self) -> Result<Option<Value>, SyntaxError> {
        if self.within_tag {
            self.within_tag = false;
            return self.parse_tag();
        }
        let mut s = String::new();
        while let Some(c) = self.next_char()? {
            if c == '[' {
                if let Some('[') = self.peek_char() {
                    self.next_char()?;
                } else if s.is_empty() {
                    return self.parse_tag();
                } else {
                    self.within_tag = true;
                    break;
                }
            } else if c == ']' {
                if let Some(']') = self.peek_char() {
                    self.next_char()?;
                } else {
                    return Err(SyntaxError::UnsupportedTag(s));
                }
            }
            s.push(c);
        }
        if s.is_empty() {
            Ok(None)
        } else {
            Ok(Some(Value::Text(s)))
        }
    }
fn parse_value ( & mut self ) -> Result < Option < Value > , SyntaxError > { if self . within_tag { self . within_tag = false ; return self . parse_tag ( ) ; } let mut s = String :: new ( ) ; while let Some ( c ) = self . next_char ( ) ? { if c == '[' { if let Some ( '[' ) = self . peek_char ( ) { self . next_char ( ) ? ; } else if s . is_empty ( ) { return self . parse_tag ( ) ; } else { self . within_tag = true ; break ; } } else if c == ']' { if let Some ( ']' ) = self . peek_char ( ) { self . next_char ( ) ? ; } else { return Err ( SyntaxError :: UnsupportedTag ( s ) ) ; } } s . push ( c ) ; } if s . is_empty ( ) { Ok ( None ) } else { Ok ( Some ( Value :: Text ( s ) ) ) } }
Parse a value at the current position.
Parse a value at the current position .
&mut self