fn token_precedence(tok: &Token) -> Precedence {
        match tok {
            Token::Assign => Precedence::Equals,
            Token::Equal => Precedence::Equals,
            Token::NotEqual => Precedence::Equals,
            Token::Less => Precedence::LessGreater,
            Token::LessEqual => Precedence::LessGreater,
            Token::Greater => Precedence::LessGreater,
            Token::GreaterEqual => Precedence::LessGreater,
            Token::Ampersand => Precedence::Sum,
            Token::Caret => Precedence::Sum,
            Token::Pipe => Precedence::Sum,
            Token::Plus => Precedence::Sum,
            Token::Minus => Precedence::Sum,
            Token::Slash => Precedence::Product,
            Token::Star => Precedence::Product,
            Token::Keyword(Keyword::As) => Precedence::Prefix,
            Token::LeftParen => Precedence::Call,
            Token::LeftBracket => Precedence::Index,
            _ => Precedence::Lowest,
        }
    }
// Higher the number, the higher(more priority) the precedence
// XXX: Check the precedence is correct for operators
Higher the number, the higher(more priority) the precedence
XXX: Check the precedence is correct for operators
Higher the number the higher ( more priority ) the precedence XXX : Check the precedence is correct for operators
fn token_precedence(tok: &Token) -> Precedence {
        match tok {
            Token::Assign => Precedence::Equals,
            Token::Equal => Precedence::Equals,
            Token::NotEqual => Precedence::Equals,
            Token::Less => Precedence::LessGreater,
            Token::LessEqual => Precedence::LessGreater,
            Token::Greater => Precedence::LessGreater,
            Token::GreaterEqual => Precedence::LessGreater,
            Token::Ampersand => Precedence::Sum,
            Token::Caret => Precedence::Sum,
            Token::Pipe => Precedence::Sum,
            Token::Plus => Precedence::Sum,
            Token::Minus => Precedence::Sum,
            Token::Slash => Precedence::Product,
            Token::Star => Precedence::Product,
            Token::Keyword(Keyword::As) => Precedence::Prefix,
            Token::LeftParen => Precedence::Call,
            Token::LeftBracket => Precedence::Index,
            _ => Precedence::Lowest,
        }
    }
fn token_precedence ( tok : & Token ) -> Precedence { match tok { Token :: Assign => Precedence :: Equals , Token :: Equal => Precedence :: Equals , Token :: NotEqual => Precedence :: Equals , Token :: Less => Precedence :: LessGreater , Token :: LessEqual => Precedence :: LessGreater , Token :: Greater => Precedence :: LessGreater , Token :: GreaterEqual => Precedence :: LessGreater , Token :: Ampersand => Precedence :: Sum , Token :: Caret => Precedence :: Sum , Token :: Pipe => Precedence :: Sum , Token :: Plus => Precedence :: Sum , Token :: Minus => Precedence :: Sum , Token :: Slash => Precedence :: Product , Token :: Star => Precedence :: Product , Token :: Keyword ( Keyword :: As ) => Precedence :: Prefix , Token :: LeftParen => Precedence :: Call , Token :: LeftBracket => Precedence :: Index , _ => Precedence :: Lowest , } }
Higher the number, the higher(more priority) the precedence
XXX: Check the precedence is correct for operators
Higher the number the higher ( more priority ) the precedence XXX : Check the precedence is correct for operators
tok
&Token
tok
&Token