<commit_before>module Test where

import Proto
import Types

import Control.Monad


main = pretty "Test" test_xdecs

pretty :: String -> [XDecl] -> IO ()
pretty name decs = putStrLn $ prettyBuild name $ mapM_ xDecl decs

test_xdecs = [XidType "ATOM"
             ,XidType "WINDOW"
             ,XidType "FONT"
             ,XTypeDef "VISUALID" "CARD32"
             ,XTypeDef "TIMESTAMP" "CARD32"
             ,XTypeDef "KEYSYM" "CARD32"
             ,pointStruct
             ,rectStruct
             ,screenStruct
             ,XImport "xproto"
             ,XImport "xfiles"
             ]


pointStruct = XStruct "POINT"
              [SField "x" "INT16"
              ,SField "y" "INT16"
              ]

rectStruct = XStruct "RECTANGLE"
             [SField "x" "INT16"
             ,SField "y" "INT16"
             ,SField "width" "CARD16"
             ,SField "height" "CARD16"
             ]

screenStruct = XStruct "SCREEN"
               [SField "root" "WINDOW"
               ,SField "default_colormap" "COLORMAP"
               ,SField "white_pixel" "CARD32"
               ,SField "black_pixel" "CARD32"
               ,SField "curren_input_masks" "CARD32"
               ,SField "width_in_pixels" "CARD16"
               ,SField "height_in_pixels" "CARD16"
               ,SField "width_in_millimeters" "CARD16"
               ,SField "height_in_millimeters" "CARD16"
               ,SField "min_installed_maps" "CARD16"
               ,SField "max_installed_maps" "CARD16"
               ,SField "root_visual" "VISUALID"
               ,SField "backing_stores" "BYTE"
               ,SField "save_unders" "BOOL"
               ,SField "root_depth" "CARD8"
               ,ListSize "allowed_depths_len" "CARD8" "allowed_depths"
               ,List "allowed_depths" "DEPTH" "allowed_depths_len"
               ]
<commit_msg>add events to Test module<commit_after>module Test where

import Proto
import Types

import Control.Monad


main = pretty "Test" test_xdecs

pretty :: String -> [XDecl] -> IO ()
pretty name decs = putStrLn $ prettyBuild name $ mapM_ xDecl decs

test_xdecs = [XidType "ATOM"
             ,XidType "WINDOW"
             ,XidType "FONT"
             ,XTypeDef "VISUALID" "CARD32"
             ,XTypeDef "TIMESTAMP" "CARD32"
             ,XTypeDef "KEYSYM" "CARD32"
             ,pointStruct
             ,rectStruct
             ,screenStruct
             ,XImport "xproto"
             ,XImport "xfiles"
             ,testEvent
             ,testEvent2
             ]


pointStruct = XStruct "POINT"
              [SField "x" "INT16"
              ,SField "y" "INT16"
              ]

rectStruct = XStruct "RECTANGLE"
             [SField "x" "INT16"
             ,SField "y" "INT16"
             ,SField "width" "CARD16"
             ,SField "height" "CARD16"
             ]

screenStruct = XStruct "SCREEN"
               [SField "root" "WINDOW"
               ,SField "default_colormap" "COLORMAP"
               ,SField "white_pixel" "CARD32"
               ,SField "black_pixel" "CARD32"
               ,SField "curren_input_masks" "CARD32"
               ,SField "width_in_pixels" "CARD16"
               ,SField "height_in_pixels" "CARD16"
               ,SField "width_in_millimeters" "CARD16"
               ,SField "height_in_millimeters" "CARD16"
               ,SField "min_installed_maps" "CARD16"
               ,SField "max_installed_maps" "CARD16"
               ,SField "root_visual" "VISUALID"
               ,SField "backing_stores" "BYTE"
               ,SField "save_unders" "BOOL"
               ,SField "root_depth" "CARD8"
               ,ListSize "allowed_depths_len" "CARD8" "allowed_depths"
               ,List "allowed_depths" "DEPTH" "allowed_depths_len"
               ]

testEvent = XEvent "MyEvent" 23
            [SField "screen" "SCREEN"
            ,SField "x" "INT16"
            ,SField "y" "INT16"
            ]

testEvent2 = XEvent "MyOtherEvent" 24
             [SField "rect" "RECTANGLE"
             ,SField "left" "POINT"
             ,SField "right" "POINT"
             ]
{'fraction_non_alphanumeric': 0.10162802170695609, 'fraction_numerical': 0.021213616181549086, 'mean_word_length': 1.667763157894737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7596680', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1308, 'n_words': 290}