<commit_before><?php

/**
 * CSSTidy - CSS Parser and Optimiser
 *
 * CSS Parser class
 *
 * Copyright 2005, 2006, 2007 <NAME>
 *
 * This file is part of CSSTidy.
 *
 *   CSSTidy 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.
 *
 *   CSSTidy 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 program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
 * @package csstidy
 * @author <NAME> (floele at gmail dot com) 2005-2007
 * @author <NAME> (brettz9 at yahoo dot com) 2007
 * @author <NAME> (speed at webo dot name) 2009-2010
 * @author <NAME> (cedric at yterium dot com) 2010-2012
 * @author <NAME> (cfinke at gmail.com) 2012
 * @author <NAME> (remove $GLOBALS once and for all + PHP5.4 comp) 2012
 */

/**
 * Defines ctype functions if required
 * @todo make them methods of csstidy class
 * @version 1.0
 */
if (!function_exists('ctype_space')) {
	/* ctype_space  Check for whitespace character(s) */
	function ctype_space($text) {
		return!preg_match("/[^\s\r\n\t\f]/", $text);
	}

}
if (!function_exists('ctype_alpha')) {
	/* ctype_alpha  Check for alphabetic character(s) */
	function ctype_alpha($text) {
		return preg_match("/[a-zA-Z]/", $text);
	}

}

/**
 * Defines constants
 * @todo //TODO: make them class constants of csstidy
 */
define('AT_START',    1);
define('AT_END',      2);
define('SEL_START',   3);
define('SEL_END',     4);
define('PROPERTY',    5);
define('VALUE',       6);
define('COMMENT',     7);
define('DEFAULT_AT', 41);

/**
 * Contains a class for printing CSS code
 *
 * @version 1.0
 */
require('class.csstidy_print.php');

/**
 * Contains a class for optimising CSS code
 *
 * @version 1.0
 */
require('class.csstidy_optimise.php');

/**
 * CSS Parser class
 *
 * This class represents a CSS parser which reads CSS code and saves it in an array.
 * In opposite to most other CSS parsers, it does not use regular expressions and
 * thus has full CSS2 support and a higher reliability.
 * Additional to that it applies some optimisations and fixes to the CSS code.
 * An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
 * @package csstidy
 * @author <NAME> (<EMAIL> at <EMAIL>) 2005-2006
 * @version 1.4.0
 */
class csstidy {

	/**
	 * Saves the parsed CSS. This array is empty if preserve_css is on.
	 * @var array
	 * @access public
	 */
	public $css = array();
	/**
	 * Saves the parsed CSS (raw)
	 * @var array
	 * @access private
	 */
	public $tokens = array();
	/**
	 * Printer class
	 * @see csstidy_print
	 * @var object
	 * @access public
	 */
	public $print;
	/**
	 * Optimiser class
	 * @see csstidy_optimise
	 * @var object
	 * @access private
	 */
	public $optimise;
	/**
	 * Saves the CSS charset (@charset)
	 * @var string
	 * @access private
	 */
	public $charset = '';
	/**
	 * Saves all @import URLs
	 * @var array
	 * @access private
	 */
	public $import = array();
	/**
	 * Saves the namespace
	 * @var string
	 * @access private
	 */
	public $namespace = '';
	/**
	 * Contains the version of csstidy
	 * @var string
	 * @access private
	 */
	public $version = '1.5';
	/**
	 * Stores the settings
	 * @var array
	 * @access private<commit_msg>version<commit_after><?php

/**
 * CSSTidy - CSS Parser and Optimiser
 *
 * CSS Parser class
 *
 * Copyright 2005, 2006, 2007 <NAME>
 *
 * This file is part of CSSTidy.
 *
 *   CSSTidy 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.
 *
 *   CSSTidy 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 program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
 * @package csstidy
 * @author <NAME> (<EMAIL> at <EMAIL>) 2005-2007
 * @author <NAME> (b<EMAIL> at y<EMAIL> dot com) 2007
 * @author <NAME> (speed at webo dot name) 2009-2010
 * @author <NAME> (cedric at yterium dot com) 2010-2012
 * @author <NAME> (cfinke at gmail.<EMAIL>) 2012
 * @author <NAME> (remove $GLOBALS once and for all + PHP5.4 comp) 2012
 */

/**
 * Defines ctype functions if required
 * @todo make them methods of csstidy class
 * @version 1.0
 */
if (!function_exists('ctype_space')) {
	/* ctype_space  Check for whitespace character(s) */
	function ctype_space($text) {
		return!preg_match("/[^\s\r\n\t\f]/", $text);
	}

}
if (!function_exists('ctype_alpha')) {
	/* ctype_alpha  Check for alphabetic character(s) */
	function ctype_alpha($text) {
		return preg_match("/[a-zA-Z]/", $text);
	}

}

/**
 * Defines constants
 * @todo //TODO: make them class constants of csstidy
 */
define('AT_START',    1);
define('AT_END',      2);
define('SEL_START',   3);
define('SEL_END',     4);
define('PROPERTY',    5);
define('VALUE',       6);
define('COMMENT',     7);
define('DEFAULT_AT', 41);

/**
 * Contains a class for printing CSS code
 *
 * @version 1.0
 */
require('class.csstidy_print.php');

/**
 * Contains a class for optimising CSS code
 *
 * @version 1.0
 */
require('class.csstidy_optimise.php');

/**
 * CSS Parser class
 *
 * This class represents a CSS parser which reads CSS code and saves it in an array.
 * In opposite to most other CSS parsers, it does not use regular expressions and
 * thus has full CSS2 support and a higher reliability.
 * Additional to that it applies some optimisations and fixes to the CSS code.
 * An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
 * @package csstidy
 * @author <NAME> (floele at gmail dot com) 2005-2006
 * @version 1.5.1
 */
class csstidy {

	/**
	 * Saves the parsed CSS. This array is empty if preserve_css is on.
	 * @var array
	 * @access public
	 */
	public $css = array();
	/**
	 * Saves the parsed CSS (raw)
	 * @var array
	 * @access private
	 */
	public $tokens = array();
	/**
	 * Printer class
	 * @see csstidy_print
	 * @var object
	 * @access public
	 */
	public $print;
	/**
	 * Optimiser class
	 * @see csstidy_optimise
	 * @var object
	 * @access private
	 */
	public $optimise;
	/**
	 * Saves the CSS charset (@charset)
	 * @var string
	 * @access private
	 */
	public $charset = '';
	/**
	 * Saves all @import URLs
	 * @var array
	 * @access private
	 */
	public $import = array();
	/**
	 * Saves the namespace
	 * @var string
	 * @access private
	 */
	public $namespace = '';
	/**
	 * Contains the version of csstidy
	 * @var string
	 * @access private
	 */
	public $version = '1.5.1';
	/**
	 * Stores the settings
	 * @var array
	 * @access private
{'fraction_non_alphanumeric': 0.12630592017144388, 'fraction_numerical': 0.021966246986338065, 'mean_word_length': 3.2426136363636364, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2593372', 'n_tokens_mistral': 2574, 'n_tokens_neox': 2349, 'n_words': 873}