Skip to content

Commit f3efc3d

Browse files
committed
[AST] NFC: Refactor ASTDumper to use a "label" abstraction.
ASTDumper allows nodes/values to be printed without labels, which works fine for the default output but won't work for JSON when every value needs to have a valid key. To balance these needs, we create a `Label` abstraction that can be created as either `always` or `optional`. All the current labels are treated as `always`, and all other values have had `optional` labels associated with them, which won't be printed in the default AST dump. This change also adds a `printList` function that replaces anywhere that `for` loops with `printRec` calls in their bodies. This will be used to provide the necessary array structuring for JSON output later. (There are some places where `for` loops call `printFlag` which will need to be dealt with later.)
1 parent 6b2fb2e commit f3efc3d

File tree

1 file changed

+1052
-958
lines changed

1 file changed

+1052
-958
lines changed

0 commit comments

Comments
 (0)