pub fn parse_order_by_expr_list(&mut self) -> Result<Vec<SQLOrderByExpr>, ParserError> {
        let mut expr_list: Vec<SQLOrderByExpr> = vec![];
        loop {
            let expr = self.parse_expr(0)?;

            // look for optional ASC / DESC specifier
            let asc = match self.peek_token() {
                Some(Token::Keyword(k)) => {
                    match k.to_uppercase().as_ref() {
                        "ASC" => {
                            self.next_token();
                            true
                        },
                        "DESC" => {
                            self.next_token();
                            false
                        },
                        _ => true
                    }
                }
                Some(Token::Comma) => true,
                _ => true,
            };

            expr_list.push(SQLOrderByExpr::new(Box::new(expr), asc));

            if let Some(t) = self.peek_token() {
                if t == Token::Comma {
                    self.next_token();
                } else {
                    break;
                }
            } else {
                // EOF
                break;
            }
        }
        Ok(expr_list)
    }
/// Parse a comma-delimited list of SQL ORDER BY expressions
Parse a comma-delimited list of SQL ORDER BY expressions
Parse a comma - delimited list of SQL ORDER BY expressions
pub fn parse_order_by_expr_list(&mut self) -> Result<Vec<SQLOrderByExpr>, ParserError> {
        let mut expr_list: Vec<SQLOrderByExpr> = vec![];
        loop {
            let expr = self.parse_expr(0)?;
            // look for optional ASC / DESC specifier
            let asc = match self.peek_token() {
                Some(Token::Keyword(k)) => {
                    match k.to_uppercase().as_ref() {
                        "ASC" => {
                            self.next_token();
                            true
                        },
                        "DESC" => {
                            self.next_token();
                            false
                        },
                        _ => true
                    }
                }
                Some(Token::Comma) => true,
                _ => true,
            };
            expr_list.push(SQLOrderByExpr::new(Box::new(expr), asc));
            if let Some(t) = self.peek_token() {
                if t == Token::Comma {
                    self.next_token();
                } else {
                    break;
                }
            } else {
                // EOF
                break;
            }
        }
        Ok(expr_list)
    }
pub fn parse_order_by_expr_list ( & mut self ) -> Result < Vec < SQLOrderByExpr > , ParserError > { let mut expr_list : Vec < SQLOrderByExpr > = vec ! [ ] ; loop { let expr = self . parse_expr ( 0 ) ? ; // look for optional ASC / DESC specifier let asc = match self . peek_token ( ) { Some ( Token :: Keyword ( k ) ) => { match k . to_uppercase ( ) . as_ref ( ) { " " => { self . next_token ( ) ; true } , " " => { self . next_token ( ) ; false } , _ => true } } Some ( Token :: Comma ) => true , _ => true , } ; expr_list . push ( SQLOrderByExpr :: new ( Box :: new ( expr ) , asc ) ) ; if let Some ( t ) = self . peek_token ( ) { if t == Token :: Comma { self . next_token ( ) ; } else { break ; } } else { // EOF break ; } } Ok ( expr_list ) }
Parse a comma-delimited list of SQL ORDER BY expressions
Parse a comma - delimited list of SQL ORDER BY expressions
&mut self
&mut self