# CRC generation
import json

process_imports = True


#
# Plugin entry point
#
def run(args, input_filename, s):
    j = {}
    major = 0
    minor = 0
    patch = 0
    if 'version' in s['Option']:
        v = s['Option']['version']
        (major, minor, patch) = v.split('.')
    j['_version'] = {'major': major, 'minor': minor, 'patch': patch}
    for t in s['Define']:
        j[t.name] = {'crc': f'{t.crc:#08x}', 'version': major,
                     'options': t.options}
    return json.dumps(j, indent=4, separators=(',', ': '))
