fn parse_value(&mut self) -> Result<Value, ParserError> {
        match self.parser.next_token() {
            Token::Word(w) => match w.keyword {
                Keyword::TRUE => Ok(Value::Boolean(true)),
                Keyword::FALSE => Ok(Value::Boolean(false)),
                Keyword::NULL => Ok(Value::Null),
                Keyword::NoKeyword if w.quote_style.is_some() => match w.quote_style {
                    Some('"') => Ok(Value::DoubleQuotedString(w.value)),
                    Some('\'') => Ok(Value::SingleQuotedString(w.value)),
                    _ => self.expected("A value?", Token::Word(w))?,
                },
                _ => self.expected("a concrete value", Token::Word(w)),
            },
            // The call to n.parse() returns a bigdecimal when the
            // bigdecimal feature is enabled, and is otherwise a no-op
            // (i.e., it returns the input string).
            Token::Number(ref n, l) => match n.parse() {
                Ok(n) => Ok(Value::Number(n, l)),
                Err(e) => parser_err!(format!("Could not parse '{}' as number: {}", n, e)),
            },
            Token::SingleQuotedString(ref s) => Ok(Value::SingleQuotedString(s.to_string())),
            Token::NationalStringLiteral(ref s) => Ok(Value::NationalStringLiteral(s.to_string())),
            Token::HexStringLiteral(ref s) => Ok(Value::HexStringLiteral(s.to_string())),
            unexpected => self.expected("a value", unexpected),
        }
    }
/// This is a copy from sqlparser
/// Parse a literal value (numbers, strings, date/time, booleans)
This is a copy from sqlparser
Parse a literal value (numbers, strings, date/time, booleans)
This is a copy from sqlparser Parse a literal value ( numbers strings date / time booleans )
fn parse_value(&mut self) -> Result<Value, ParserError> {
        match self.parser.next_token() {
            Token::Word(w) => match w.keyword {
                Keyword::TRUE => Ok(Value::Boolean(true)),
                Keyword::FALSE => Ok(Value::Boolean(false)),
                Keyword::NULL => Ok(Value::Null),
                Keyword::NoKeyword if w.quote_style.is_some() => match w.quote_style {
                    Some('"') => Ok(Value::DoubleQuotedString(w.value)),
                    Some('\'') => Ok(Value::SingleQuotedString(w.value)),
                    _ => self.expected("A value?", Token::Word(w))?,
                },
                _ => self.expected("a concrete value", Token::Word(w)),
            },
            // The call to n.parse() returns a bigdecimal when the
            // bigdecimal feature is enabled, and is otherwise a no-op
            // (i.e., it returns the input string).
            Token::Number(ref n, l) => match n.parse() {
                Ok(n) => Ok(Value::Number(n, l)),
                Err(e) => parser_err!(format!("Could not parse '{}' as number: {}", n, e)),
            },
            Token::SingleQuotedString(ref s) => Ok(Value::SingleQuotedString(s.to_string())),
            Token::NationalStringLiteral(ref s) => Ok(Value::NationalStringLiteral(s.to_string())),
            Token::HexStringLiteral(ref s) => Ok(Value::HexStringLiteral(s.to_string())),
            unexpected => self.expected("a value", unexpected),
        }
    }
fn parse_value ( & mut self ) -> Result < Value , ParserError > { match self . parser . next_token ( ) { Token :: Word ( w ) => match w . keyword { Keyword :: TRUE => Ok ( Value :: Boolean ( true ) ) , Keyword :: FALSE => Ok ( Value :: Boolean ( false ) ) , Keyword :: NULL => Ok ( Value :: Null ) , Keyword :: NoKeyword if w . quote_style . is_some ( ) => match w . quote_style { Some ( '"' ) => Ok ( Value :: DoubleQuotedString ( w . value ) ) , Some ( '\'' ) => Ok ( Value :: SingleQuotedString ( w . value ) ) , _ => self . expected ( " " , Token :: Word ( w ) ) ? , } , _ => self . expected ( " " , Token :: Word ( w ) ) , } , // The call to n.parse() returns a bigdecimal when the // bigdecimal feature is enabled, and is otherwise a no-op // (i.e., it returns the input string). Token :: Number ( ref n , l ) => match n . parse ( ) { Ok ( n ) => Ok ( Value :: Number ( n , l ) ) , Err ( e ) => parser_err ! ( format ( " " n e ) ) , } , Token :: SingleQuotedString ( ref s ) => Ok ( Value :: SingleQuotedString ( s . to_string ( ) ) ) , Token :: NationalStringLiteral ( ref s ) => Ok ( Value :: NationalStringLiteral ( s . to_string ( ) ) ) , Token :: HexStringLiteral ( ref s ) => Ok ( Value :: HexStringLiteral ( s . to_string ( ) ) ) , unexpected => self . expected ( " " , unexpected ) , } }
This is a copy from sqlparser
Parse a literal value (numbers, strings, date/time, booleans)
This is a copy from sqlparser Parse a literal value ( numbers strings date / time booleans )
&mut self
&mut self