<commit_before>/* Copyright (C) <NAME> and <NAME> - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited
 * Proprietary and confidential
 */

#include <stdio.h>
#include "parser.h"

#define PARSE_DEBUG_PRINT 0

// =====================================================
// Abstract Syntax Tree
// =====================================================

NecroAST_Node* ast_alloc_node(NecroAST* ast)
{
    return (NecroAST_Node*) arena_alloc(&ast->arena, sizeof(NecroAST_Node), arena_allow_realloc);
}

NecroAST_Node* ast_alloc_node_local_ptr(NecroAST* ast, NecroAST_LocalPtr* local_ptr)
{
    *local_ptr = ast->arena.size / sizeof(NecroAST_Node);
    return (NecroAST_Node*) arena_alloc(&ast->arena, sizeof(NecroAST_Node), arena_allow_realloc);
}

NecroAST_LocalPtr ast_last_node_ptr(NecroAST* ast)
{
    NecroAST_LocalPtr local_ptr = null_local_ptr;
    if (ast->arena.size > 0)
    {<commit_msg>removed debug printing (for real)<commit_after>/* Copyright (C) <NAME> and <NAME> - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited
 * Proprietary and confidential
 */

#include <stdio.h>
#include "parser.h"

//#define PARSE_DEBUG_PRINT 1

// =====================================================
// Abstract Syntax Tree
// =====================================================

NecroAST_Node* ast_alloc_node(NecroAST* ast)
{
    return (NecroAST_Node*) arena_alloc(&ast->arena, sizeof(NecroAST_Node), arena_allow_realloc);
}

NecroAST_Node* ast_alloc_node_local_ptr(NecroAST* ast, NecroAST_LocalPtr* local_ptr)
{
    *local_ptr = ast->arena.size / sizeof(NecroAST_Node);
    return (NecroAST_Node*) arena_alloc(&ast->arena, sizeof(NecroAST_Node), arena_allow_realloc);
}

NecroAST_LocalPtr ast_last_node_ptr(NecroAST* ast)
{
    NecroAST_LocalPtr local_ptr = null_local_ptr;
    if (ast->arena.size > 0)
    {
{'fraction_non_alphanumeric': 0.2133051742344245, 'fraction_numerical': 0.0021119324181626186, 'mean_word_length': 5.992619926199262, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, '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': '1252153', 'n_tokens_mistral': 660, 'n_tokens_neox': 641, 'n_words': 130}