<commit_before>//
//  gravity_delegate.h
//  gravity
//
//  Created by <NAME> on 09/12/14.
//  Copyright (c) 2014 CreoLabs. All rights reserved.
//

#ifndef __GRAVITY_DELEGATE__
#define __GRAVITY_DELEGATE__

#include <stdint.h>
#include "gravity_value.h"

// error type and code definitions
typedef enum {
    GRAVITY_ERROR_NONE = 0,
    GRAVITY_ERROR_SYNTAX,
    GRAVITY_ERROR_SEMANTIC,
    GRAVITY_ERROR_RUNTIME,
    GRAVITY_ERROR_IO,
    GRAVITY_WARNING,
} error_type_t;

typedef struct {
    uint32_t        lineno;
    uint32_t        colno;
    uint32_t        fileid;
    uint32_t        offset;
} error_desc_t;

#define ERROR_DESC_NONE     (error_desc_t){0,0,0,0}

typedef void                (*gravity_error_callback) (gravity_vm *vm, error_type_t error_type, const char *description, error_desc_t error_desc, void *xdata);
typedef void                (*gravity_log_callback)    (gravity_vm *vm, const char *message, void *xdata);
typedef void                (*gravity_log_clear) (gravity_vm *vm, void *xdata);
typedef void                (*gravity_unittest_callback) (gravity_vm *vm, error_type_t error_type, const char *desc, const char *note, gravity_value_t value, int32_t row, int32_t col, void *xdata);
typedef const char*         (*gravity_filename_callback) (uint32_t fileid, void *xdata);
typedef const char*         (*gravity_loadfile_callback) (const char *file, size_t *size, uint32_t *fileid, void *xdata, bool *is_static);
typedef const char**        (*gravity_optclass_callback) (void *xdata);
typedef void                (*gravity_parser_callback) (void *token, void *xdata);
typedef const char*         (*gravity_precode_callback) (void *xdata);
typedef void                (*gravity_type_callback) (void *token, const char *type, void *xdata);

typedef void                (*gravity_bridge_blacken) (gravity_vm *vm, void *xdata);
typedef void*               (*gravity_bridge_clone)  (gravity_vm *vm, void *xdata);
typedef bool                (*gravity_bridge_equals) (gravity_vm *vm, void *obj1, void *obj2);
typedef bool                (*gravity_bridge_execute)  (gravity_vm *vm, void *xdata, gravity_value_t ctx, gravity_value_t args[], int16_t nargs, uint32_t vindex);
typedef void                (*gravity_bridge_free) (gravity_vm *vm, gravity_object_t *obj);
typedef bool                (*gravity_bridge_getundef) (gravity_vm *vm, void *xdata, gravity_value_t target, const char *key, uint32_t vindex);
typedef bool                (*gravity_bridge_getvalue) (gravity_vm *vm, void *xdata, gravity_value_t target, const char *key, uint32_t vindex);
typedef bool                (*gravity_bridge_initinstance) (gravity_vm *vm, void *xdata, gravity_value_t ctx, gravity_instance_t *instance, gravity_value_t args[], int16_t nargs);
typedef bool                (*gravity_bridge_setvalue) (gravity_vm *vm, void *xdata, gravity_value_t target, const char *key, gravity_value_t value);
typedef bool                (*gravity_bridge_setundef) (gravity_vm *vm, void *xdata, gravity_value_t target, const char *key, gravity_value_t value);
typedef uint32_t            (*gravity_bridge_size) (gravity_vm *vm, gravity_object_t *obj);<commit_msg>Fixed a minor double space typo<commit_after>//
//  gravity_delegate.h
//  gravity
//
//  Created by Marco Bambini on 09/12/14.
//  Copyright (c) 2014 CreoLabs. All rights reserved.
//

#ifndef __GRAVITY_DELEGATE__
#define __GRAVITY_DELEGATE__

#include <stdint.h>
#include "gravity_value.h"

// error type and code definitions
typedef enum {
    GRAVITY_ERROR_NONE = 0,
    GRAVITY_ERROR_SYNTAX,
    GRAVITY_ERROR_SEMANTIC,
    GRAVITY_ERROR_RUNTIME,
    GRAVITY_ERROR_IO,
    GRAVITY_WARNING,
} error_type_t;

typedef struct {
    uint32_t        lineno;
    uint32_t        colno;
    uint32_t        fileid;
    uint32_t        offset;
} error_desc_t;

#define ERROR_DESC_NONE     (error_desc_t){0,0,0,0}

typedef void                (*gravity_error_callback) (gravity_vm *vm, error_type_t error_type, const char *description, error_desc_t error_desc, void *xdata);
typedef void                (*gravity_log_callback)    (gravity_vm *vm, const char *message, void *xdata);
typedef void                (*gravity_log_clear) (gravity_vm *vm, void *xdata);
typedef void                (*gravity_unittest_callback) (gravity_vm *vm, error_type_t error_type, const char *desc, const char *note, gravity_value_t value, int32_t row, int32_t col, void *xdata);
typedef const char*         (*gravity_filename_callback) (uint32_t fileid, void *xdata);
typedef const char*         (*gravity_loadfile_callback) (const char *file, size_t *size, uint32_t *fileid, void *xdata, bool *is_static);
typedef const char**        (*gravity_optclass_callback) (void *xdata);
typedef void                (*gravity_parser_callback) (void *token, void *xdata);
typedef const char*         (*gravity_precode_callback) (void *xdata);
typedef void                (*gravity_type_callback) (void *token, const char *type, void *xdata);

typedef void                (*gravity_bridge_blacken) (gravity_vm *vm, void *xdata);
typedef void*               (*gravity_bridge_clone) (gravity_vm *vm, void *xdata);
typedef bool                (*gravity_bridge_equals) (gravity_vm *vm, void *obj1, void *obj2);
typedef bool                (*gravity_bridge_execute) (gravity_vm *vm, void *xdata, gravity_value_t ctx, gravity_value_t args[], int16_t nargs, uint32_t vindex);
typedef void                (*gravity_bridge_free) (gravity_vm *vm, gravity_object_t *obj);
typedef bool                (*gravity_bridge_getundef) (gravity_vm *vm, void *xdata, gravity_value_t target, const char *key, uint32_t vindex);
typedef bool                (*gravity_bridge_getvalue) (gravity_vm *vm, void *xdata, gravity_value_t target, const char *key, uint32_t vindex);
typedef bool                (*gravity_bridge_initinstance) (gravity_vm *vm, void *xdata, gravity_value_t ctx, gravity_instance_t *instance, gravity_value_t args[], int16_t nargs);
typedef bool                (*gravity_bridge_setvalue) (gravity_vm *vm, void *xdata, gravity_value_t target, const char *key, gravity_value_t value);
typedef bool                (*gravity_bridge_setundef) (gravity_vm *vm, void *xdata, gravity_value_t target, const char *key, gravity_value_t value);
typedef uint32_t            (*gravity_bridge_size) (gravity_vm *vm, gravity_object_t *obj);
{'fraction_non_alphanumeric': 0.09642350716874114, 'fraction_numerical': 0.014179927524814874, 'mean_word_length': 3.6301969365426694, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '944947', 'n_tokens_mistral': 2260, 'n_tokens_neox': 2013, 'n_words': 563}