Skip to content

Commit

Permalink
patch: assign an empty list to an empty case statement instead of Non…
Browse files Browse the repository at this point in the history
…e when saving AST as JSON.
  • Loading branch information
kmg3821 committed Jul 24, 2024
1 parent ab00af8 commit cf7544d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/c_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cf7544d

Please sign in to comment.