<commit_before>#include "language/grammar/WhiteSpace.h"
#include "language/grammar/ThorScriptPackageDependencyGrammar.h"

namespace zillians { namespace language { namespace grammar {

template<typename Iterator>                                                                                                                                                                                        
bool getImportedPackagesTImpl(Iterator first, Iterator end, std::vector<std::wstring>& v)                                                                                                                              
{                                                                                                                                                                                                                  
    bool r = qi::phrase_parse(first, end,                                                                                                                                                                         
            // Begin grammar                                                                                                                                                                                       
            (                                                                                                                                                                                                      
                  -( (L"package" > *(boost::spirit::unicode::char_ - ';') > L';') )                                                                                                                                
                > *( (L"import"  > boost::spirit::as_wstring[*unicode::char_(L"0-9a-zA-Z_.")][boost::phoenix::push_back(boost::phoenix::ref(v), boost::spirit::qi::_1)] > L';') )                                         
                > *( boost::spirit::unicode::char_ )
                > qi::eoi
            )                                                                                                                                                                                                      
            ,                                                                                                                                                                                                      
            // End grammar                                                                                                                                                                                         
            detail::WhiteSpace<Iterator>());                                                                                                                                                                                   
    return r ;                                                                                                                                                                                                     
}

bool getImportedPackages(pos_iterator_type begin, pos_iterator_type end, std::vector<std::wstring>& v)
{
    return getImportedPackagesTImpl(begin, end, v);
}

} } } // zillians language grammar<commit_msg>refactor some spirit code -- cosmetic changes<commit_after>#include "language/grammar/WhiteSpace.h"
#include "language/grammar/ThorScriptPackageDependencyGrammar.h"

namespace zillians { namespace language { namespace grammar {

template<typename Iterator>
bool getImportedPackagesTImpl(Iterator begin, Iterator end, std::vector<std::wstring>& v)
{
    return qi::phrase_parse(begin, end,
            // Begin grammar
            (
                  -( (L"package" > *(boost::spirit::unicode::char_ - ';') > L';') )
                > *( (L"import"  > boost::spirit::as_wstring[*unicode::char_(L"0-9a-zA-Z_.")][boost::phoenix::push_back(boost::phoenix::ref(v), boost::spirit::qi::_1)] > L';') )                                         
                > *( boost::spirit::unicode::char_ )
                > qi::eoi
            ),
            // End grammar
            detail::WhiteSpace<Iterator>());
}

bool getImportedPackages(pos_iterator_type begin, pos_iterator_type end, std::vector<std::wstring>& v)
{
    return getImportedPackagesTImpl(begin, end, v);
}

} } } // zillians language grammar
{'fraction_non_alphanumeric': 0.07679926419866635, 'fraction_numerical': 0.0013796275005748448, 'mean_word_length': 0.5875912408759124, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 98, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1094345', 'n_tokens_mistral': 703, 'n_tokens_neox': 658, 'n_words': 107}