<commit_before>/**
 * Copyright (C) 2012 The CompilerKit contributors.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
#include "CompilerKit/kleene-star.h"
#define COMPILERKIT_KLEENE_STAR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), COMPILERKIT_TYPE_KLEENE_STAR, CompilerKitKleeneStarPrivate))
G_DEFINE_TYPE(CompilerKitKleeneStar, compilerkit_kleene_star, G_TYPE_OBJECT);

static void compilerkit_kleene_star_finalize (GObject* object);
static void compilerkit_kleene_star_dispose (GObject* object);

/**
 * @struct _CompilerKitKleeneStarPrivate
 * The private fields of the CompilerKitKleeneStar struct.
 * 
 * @see #CompilerKitKleeneStar
 */
struct _CompilerKitKleeneStarPrivate
{
    /** The regular expression to match 0 or more times. */
    GObject *node;
};

/**
 * compilerkit_kleene_star_class_init:
 * @fn compilerkit_kleene_star_class_init
 * Initializes the CompilerKitKleeneStarClass (virtual table).
 * @pre klass is not NULL.
 * @param CompilerKitKleeneStarClass to initialize
 * @return void
 */
static void
compilerkit_kleene_star_class_init (CompilerKitKleeneStarClass *klass)
{
  GObjectClass *g_object_class;
  
  /* Add private structure */
  g_type_class_add_private (klass, sizeof (CompilerKitKleeneStarPrivate));
  
  /* Get the parent gobject class */
  g_object_class = G_OBJECT_CLASS(klass);
  
  /* Hook finalization functions */
  g_object_class->dispose = compilerkit_kleene_star_dispose;   /* instance destructor, reverse of init */
  g_object_class->finalize = compilerkit_kleene_star_finalize; /* class finalization, reverse of class init */
}

/**
 * compilerkit_kleene_star_init:
 * @fn compilerkit_kleene_star_init 
 * Initializes the CompilerKitKleeneStar instance.
 * @pre self is not NULL.
 * @param CompilerKitKleeneStar to initialize
 * @return void
 */
static void
compilerkit_kleene_star_init (CompilerKitKleeneStar *self)
{
    CompilerKitKleeneStarPrivate *priv;

    self->priv = priv = COMPILERKIT_KLEENE_STAR_GET_PRIVATE (self);

    priv->node = NULL;
}

/**
 * compilerkit_kleene_star_new:
 * @fn compilerkit_kleene_star_new
 * @memberof CompilerKitKleeneStar
 * Construct a CompilerKitKleeneStar instance.
 * @pre None
 * @param None
 * @return A new CompilerKitKleeneStar struct, cast to GObject*.
 */
GObject *compilerkit_kleene_star_new (GObject *node)
{
	CompilerKitKleeneStar* result = COMPILERKIT_KLEENE_STAR (g_object_new (COMPILERKIT_TYPE_KLEENE_STAR, NULL));
    result->priv->node = node;
    return G_OBJECT(result);
}

/**
 * compilerkit_kleene_star_finalize:
 * @fn compilerkit_kleene_star_finalize
 * Reverse what compilerkit_kleene_star_class_init allocated.
 * @pre GObject is not NULL.
 * @param GObject* An object to finalize.
 * @return void
 */
static void<commit_msg>First attempt at shortcutting empty set and string<commit_after>/**
 * Copyright (C) 2012 The CompilerKit contributors.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
#include "CompilerKit/kleene-star.h"
#include "CompilerKit/empty-set.h"
#include "CompilerKit/empty-string.h"
#define COMPILERKIT_KLEENE_STAR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), COMPILERKIT_TYPE_KLEENE_STAR, CompilerKitKleeneStarPrivate))
G_DEFINE_TYPE(CompilerKitKleeneStar, compilerkit_kleene_star, G_TYPE_OBJECT);

static void compilerkit_kleene_star_finalize (GObject* object);
static void compilerkit_kleene_star_dispose (GObject* object);

/**
 * @struct _CompilerKitKleeneStarPrivate
 * The private fields of the CompilerKitKleeneStar struct.
 * 
 * @see #CompilerKitKleeneStar
 */
struct _CompilerKitKleeneStarPrivate
{
    /** The regular expression to match 0 or more times. */
    GObject *node;
};

/**
 * compilerkit_kleene_star_class_init:
 * @fn compilerkit_kleene_star_class_init
 * Initializes the CompilerKitKleeneStarClass (virtual table).
 * @pre klass is not NULL.
 * @param CompilerKitKleeneStarClass to initialize
 * @return void
 */
static void
compilerkit_kleene_star_class_init (CompilerKitKleeneStarClass *klass)
{
  GObjectClass *g_object_class;
  
  /* Add private structure */
  g_type_class_add_private (klass, sizeof (CompilerKitKleeneStarPrivate));
  
  /* Get the parent gobject class */
  g_object_class = G_OBJECT_CLASS(klass);
  
  /* Hook finalization functions */
  g_object_class->dispose = compilerkit_kleene_star_dispose;   /* instance destructor, reverse of init */
  g_object_class->finalize = compilerkit_kleene_star_finalize; /* class finalization, reverse of class init */
}

/**
 * compilerkit_kleene_star_init:
 * @fn compilerkit_kleene_star_init 
 * Initializes the CompilerKitKleeneStar instance.
 * @pre self is not NULL.
 * @param CompilerKitKleeneStar to initialize
 * @return void
 */
static void
compilerkit_kleene_star_init (CompilerKitKleeneStar *self)
{
    CompilerKitKleeneStarPrivate *priv;

    self->priv = priv = COMPILERKIT_KLEENE_STAR_GET_PRIVATE (self);

    priv->node = NULL;
}

/**
 * compilerkit_kleene_star_new:
 * @fn compilerkit_kleene_star_new
 * @memberof CompilerKitKleeneStar
 * Construct a CompilerKitKleeneStar instance.
 * @pre None
 * @param None
 * @return A new CompilerKitKleeneStar struct.
 */
GObject* compilerkit_kleene_star_new (GObject *node)
{
	if(G_TYPE_FROM_INSTANCE(node) == COMPILERKIT_TYPE_EMPTY_SET)
		return node;
	else if(G_TYPE_FROM_INSTANCE(node) == COMPILERKIT_TYPE_EMPTY_STRING)
		return node;
	else
	{
		CompilerKitKleeneStar* result = COMPILERKIT_KLEENE_STAR (g_object_new (COMPILERKIT_TYPE_KLEENE_STAR, NULL));
		result->priv->node = node;
		return (GObject*) result;
	}
}

/**
 * compilerkit_kleene_star_finalize:
 * @fn compilerkit_kleene_star_finalize
 * Reverse what compilerkit_kleene_star_class_init allocated.
 * @pre GObject is not NULL.
 * @param GObject* An object to finalize.
 * @return void
 */
static void
{'fraction_non_alphanumeric': 0.07886655499720827, 'fraction_numerical': 0.005025125628140704, 'mean_word_length': 5.1030664395229985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '7512217', 'n_tokens_mistral': 2314, 'n_tokens_neox': 2279, 'n_words': 646}