From cf7544dbdc66e1eb3f8aff4b9cac5529d5a78c1b Mon Sep 17 00:00:00 2001 From: kmg3821 Date: Mon, 22 Jul 2024 09:23:58 +0900 Subject: [PATCH] patch: assign an empty list to an empty case statement instead of None when saving AST as JSON. --- examples/c_json.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/c_json.py b/examples/c_json.py index 7eafdc58..cab05e42 100644 --- a/examples/c_json.py +++ b/examples/c_json.py @@ -116,6 +116,8 @@ def to_dict(node): for child_attr in child_attrs_of(klass): if child_attr not in result: result[child_attr] = None + if result['_nodetype'] == "Case" : + result[child_attr] = [] return result