<commit_before><?php
/**
 * File containing the ezcTemplateFloatSourceToTstParser class
 *
 * @package Template
 * @version //autogen//
 * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 */
/**
 * Parser for float types.
 *
 * Floats are defined in the same way as in PHP.
 *
 * @package Template
 * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 * @version //autogen//
 */
class ezcTemplateFloatSourceToTstParser extends ezcTemplateLiteralSourceToTstParser
{
    /**
     * Passes control to parent.
     */
    function __construct( ezcTemplateParser $parser, /*ezcTemplateSourceToTstParser*/ $parentParser, /*ezcTemplateCursor*/ $startCursor )
    {
        parent::__construct( $parser, $parentParser, $startCursor );
    }

    /**
     * Parses the float types by looking for float expression.
     */
    protected function parseCurrent( ezcTemplateCursor $cursor )
    {
        if ( !$cursor->atEnd() )
        {
            $matches = $cursor->pregMatch( "#^-?[0-9]*\\.[0-9]+#" );
            if ( $matches !== false )
            {
                $float = $this->parser->createLiteral( $this->startCursor, $cursor );
                $float->value = (float)$matches;
                $this->value = $float->value;
                $this->element = $float;
                $this->appendElement( $float );
                return true;
            }
        }
        return false;
    }

    public function getTypeName()
    {
        return "float";
    }
}
<commit_msg>- Float must have a decimal in front of the dot.<commit_after><?php
/**
 * File containing the ezcTemplateFloatSourceToTstParser class
 *
 * @package Template
 * @version //autogen//
 * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 */
/**
 * Parser for float types.
 *
 * Floats are defined in the same way as in PHP.
 *
 * @package Template
 * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 * @version //autogen//
 */
class ezcTemplateFloatSourceToTstParser extends ezcTemplateLiteralSourceToTstParser
{
    /**
     * Passes control to parent.
     */
    function __construct( ezcTemplateParser $parser, /*ezcTemplateSourceToTstParser*/ $parentParser, /*ezcTemplateCursor*/ $startCursor )
    {
        parent::__construct( $parser, $parentParser, $startCursor );
    }

    /**
     * Parses the float types by looking for float expression.
     */
    protected function parseCurrent( ezcTemplateCursor $cursor )
    {
        if ( !$cursor->atEnd() )
        {
            $matches = $cursor->pregMatch( "#^-?[0-9]+\\.[0-9]+#" );
            if ( $matches !== false )
            {
                $float = $this->parser->createLiteral( $this->startCursor, $cursor );
                $float->value = (float)$matches;
                $this->value = $float->value;
                $this->element = $float;
                $this->appendElement( $float );
                return true;
            }
        }
        return false;
    }

    public function getTypeName()
    {
        return "float";
    }
}

{'fraction_non_alphanumeric': 0.12924556657649533, 'fraction_numerical': 0.012022843402464683, 'mean_word_length': 2.26594700686948, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '7053931', 'n_tokens_mistral': 999, 'n_tokens_neox': 938, 'n_words': 256}