def variable_id(printer, ast):
    """Prints "varName [= initData]"."""
    var_name_str = ast["varName"]
    array_decl_str = ''.join(map(lambda decl: f'[{printer.ast_to_string(decl)}]', ast["arrayDecl"]))
    init_data_str = f' = {printer.ast_to_string(ast["initData"])}' if ast.get("initData") else ''
    return f'{var_name_str}{array_decl_str}{init_data_str}'