<commit_before>import pgmapcss.db as db
from .compile_eval import compile_eval
from .compile_value import compile_value

def compile_properties(statement, stat, indent=''):
    ret = ''

    for prop in statement['properties']:
        if prop['assignment_type'] == 'P':
            c = compile_value(prop, stat)
            ret += indent + "current['properties'][" + statement['current_pseudo_element'] + ']' +\
                '[' + repr(prop['key']) + '] = ' + c + '\n'

        elif prop['assignment_type'] == 'T':<commit_msg>Compiler::compile_properties: catch non-compilable values<commit_after>import pgmapcss.db as db
from .compile_eval import compile_eval
from .compile_value import compile_value
from .CompileError import CompileError

def compile_properties(statement, stat, indent=''):
    ret = ''

    for prop in statement['properties']:
        if prop['assignment_type'] == 'P':
            c = compile_value(prop, stat)

            if c == None:
                raise CompileError('Illegal value for property "%s" found: "%s"' % ( prop['key'], prop['value'] ))

            ret += indent + "current['properties'][" + statement['current_pseudo_element'] + ']' +\
                '[' + repr(prop['key']) + '] = ' + c + '\n'

        elif prop['assignment_type'] == 'T':
{'fraction_non_alphanumeric': 0.15629860031104198, 'fraction_numerical': 0.0, 'mean_word_length': 3.1382636655948555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4426690', 'n_tokens_mistral': 381, 'n_tokens_neox': 365, 'n_words': 93}