<commit_before>from enum import Enum
import string
from io import IOBase

from ..errors import *

Tokens = Enum("Tokens", [
    "comment",
    "identifier",
    "keyword",
    "operator",
    "string",
    "newline",
    "group_start",
    "group_end",
    "typeof"
])

#
# Constants
#

COMMENT_CHAR = "#"
WHITESPACE = set(" \t")
WORD_CHARACTERS = set(string.ascii_letters + "_")
KEYWORDS = {
    "def",
    "end",
    "return",
}
OPERATORS = {
    "=",
}
DIRECT_MAP = {
    "(": Tokens.group_start,
    ")": Tokens.group_end,
    ":": Tokens.typeof,
}

class Token:
    def __init__(self, type:Tokens, start:int, end:int, data:str = None):
        self.type = type
        self.start = start
        self.end = end
        self.data = data

class Lexer:
    source = None

    def __init__(self, source:IOBase):<commit_msg>Added comma token type<commit_after>from enum import Enum
import string
from io import IOBase

from ..errors import *

Tokens = Enum("Tokens", [
    "comment",
    "identifier",
    "keyword",
    "operator",
    "string",
    "newline",
    "group_start",
    "group_end",
    "typeof",
    "comma",
])

#
# Constants
#

COMMENT_CHAR = "#"
WHITESPACE = set(" \t")
WORD_CHARACTERS = set(string.ascii_letters + "_")
KEYWORDS = {
    "def",
    "end",
    "return",
}
OPERATORS = {
    "=",
}
DIRECT_MAP = {
    "(": Tokens.group_start,
    ")": Tokens.group_end,
    ":": Tokens.typeof,
    ",": Tokens.comma,
}

class Token:
    def __init__(self, type:Tokens, start:int, end:int, data:str = None):
        self.type = type
        self.start = start
        self.end = end
        self.data = data

class Lexer:
    source = None

    def __init__(self, source:IOBase):
{'fraction_non_alphanumeric': 0.15702479338842976, 'fraction_numerical': 0.0, 'mean_word_length': 2.7008733624454146, 'pattern_counts': {'":': 9, '<': 3, '<?xml version=': 0, '>': 3, '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': '1509967', 'n_tokens_mistral': 617, 'n_tokens_neox': 611, 'n_words': 132}