<commit_before>#ifndef TOKEN_H_
#define TOKEN_H_

#include <iostream>
#include <string>
#include <vector>

enum class TokenType {
    NUMBER,
    ADD,
    SUBTRACT,
    MULTIPLY,
    DIVIDE,
    EXPONENT,
};

enum class OperatorType {
    NONE,
    UNARY,
    BINARY,
    EITHER,
};

class Token {
public:
    static constexpr unsigned NULL_PRECEDENCE = -1;

    // Operators
    static const Token ADD;
    static const Token SUBTRACT;
    static const Token MULTIPLY;
    static const Token DIVIDE;
    static const Token EXPONENT;

    friend bool operator==(const Token& left, const Token& right);
    friend bool operator!=(const Token& left, const Token& right);
    friend std::ostream& operator<<(std::ostream& out, const Token& token);

public:
    Token(TokenType type, const std::string& symbol, unsigned precedence);

    static const std::vector<Token>& checkable_tokens();

    // Getters
    TokenType type() const;
    OperatorType operator_type() const;
    const std::string& name() const;
    const std::string& symbol() const;
    double value() const;
    unsigned precedence() const;<commit_msg>Fix invalid null precedence value<commit_after>#ifndef TOKEN_H_
#define TOKEN_H_

#include <iostream>
#include <string>
#include <vector>

enum class TokenType {
    NUMBER,
    ADD,
    SUBTRACT,
    MULTIPLY,
    DIVIDE,
    EXPONENT,
};

enum class OperatorType {
    NONE,
    UNARY,
    BINARY,
    EITHER,
};

class Token {
public:
    static constexpr unsigned NULL_PRECEDENCE = 0;

    // Operators
    static const Token ADD;
    static const Token SUBTRACT;
    static const Token MULTIPLY;
    static const Token DIVIDE;
    static const Token EXPONENT;

    friend bool operator==(const Token& left, const Token& right);
    friend bool operator!=(const Token& left, const Token& right);
    friend std::ostream& operator<<(std::ostream& out, const Token& token);

public:
    Token(TokenType type, const std::string& symbol, unsigned precedence);

    static const std::vector<Token>& checkable_tokens();

    // Getters
    TokenType type() const;
    OperatorType operator_type() const;
    const std::string& name() const;
    const std::string& symbol() const;
    double value() const;
    unsigned precedence() const;
{'fraction_non_alphanumeric': 0.10075454948956947, 'fraction_numerical': 0.000887705281846427, 'mean_word_length': 3.508, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6910380', 'n_tokens_mistral': 714, 'n_tokens_neox': 672, 'n_words': 225}