/// Parses a SQL string containing one SQL expression.
Parses a SQL string containing one SQL expression.
Parses a SQL string containing one SQL expression .
pub fn parse_expr(sql: &str) -> Result<Expr<Raw>, ParserError> {
    let tokens = lexer::lex(sql)?;
    let mut parser = Parser::new(sql, tokens);
    let expr = parser.parse_expr()?;
    if parser.next_token().is_some() {
        parser_err!(
            parser,
            parser.peek_prev_pos(),
            "extra token after expression"
        )
    } else {
        Ok(expr)
    }
}
pub fn parse_expr ( sql : & str ) -> Result < Expr < Raw > , ParserError > { let tokens = lexer :: lex ( sql ) ? ; let mut parser = Parser :: new ( sql , tokens ) ; let expr = parser . parse_expr ( ) ? ; if parser . next_token ( ) . is_some ( ) { parser_err ! ( parser parser peek_prev_pos ( ) " " ) } else { Ok ( expr ) } }
Parses a SQL string containing one SQL expression.
Parses a SQL string containing one SQL expression .
sql
&str