<commit_before>{
module Lexer where

import TokenTypes
}

%wrapper "posn" -- Store position info with the tokens


$digit = 0-9
$hexa  = [0-9a-fA-F]
$alpha = [a-zA-Z]
$all   = [.\n\r]
$any   = [.]

tokens :-
    $white+                                                     { wrapToken Whitespace }
    "--[" (=)* "[" ($all # \] | \] $all # [=\]])* "]"(=)*"]"    { wrapToken DashBlockComment }
    "--" (. # \[) .*                                            { wrapToken DashComment }
    "//" .*                                                     { wrapToken SlashComment }
    -- /* with ((anything except *) or (* but no / after it))* then */
    "/*" ($all # \* | \* $all # \/)* \*+ \/                     { wrapToken SlashBlockComment }

    -- Matches any number
    (((0[xX]$hexa+)(\.?$hexa*))|($digit+)(\.?$digit*))[eEpP]?[\+\-]?$digit* { wrapToken TNumber }
<commit_msg>Fixed dash dash comment error when it started with --[<commit_after>{
module Lexer where

import TokenTypes
}

%wrapper "posn" -- Store position info with the tokens


$digit = 0-9
$hexa  = [0-9a-fA-F]
$alpha = [a-zA-Z]
$all   = [.\n\r]
$any   = [.]

tokens :-
    $white+                                                     { wrapToken Whitespace }
    "--[" (=)* "[" ($all # \] | \] $all # [=\]])* "]"(=)*"]"    { wrapToken DashBlockComment }
    "--" (. # \[ | \[ (\=)* . # [=\[]) .*                                            { wrapToken DashComment }
    "//" .*                                                     { wrapToken SlashComment }
    -- /* with ((anything except *) or (* but no / after it))* then */
    "/*" ($all # \* | \* $all # \/)* \*+ \/                     { wrapToken SlashBlockComment }

    -- Matches any number
    (((0[xX]$hexa+)(\.?$hexa*))|($digit+)(\.?$digit*))[eEpP]?[\+\-]?$digit* { wrapToken TNumber }

{'fraction_non_alphanumeric': 0.22246696035242292, 'fraction_numerical': 0.005506607929515419, 'mean_word_length': 1.3907894736842106, 'pattern_counts': {'":': 0, '<': 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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2284286', 'n_tokens_mistral': 621, 'n_tokens_neox': 578, 'n_words': 117}