Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show methods for trees / Node #4

Open
mortenpi opened this issue May 17, 2022 · 0 comments
Open

show methods for trees / Node #4

mortenpi opened this issue May 17, 2022 · 0 comments

Comments

@mortenpi
Copy link
Member

There are different representations of Node object that are useful in different cases:

  1. Something short that just says that this object is a Node with some element (current behavior).

  2. Full AST printout (the current showast function, replicating the input of the @ast macro). This is useful when working with the tree manually, but is technical and can get pretty long.

    This can maybe be combined with (1), in that for large printouts we just put an ellipsis like we do for large arrays.

  3. Pretty-printed document (the behaviour of CommonMark). This is useful for users who do not want to be concerned with the technical details of the representation, and also relevant for e.g. rendering docstrings.

We need to decide on which one should be the default output if a Node is returned in the REPL, and how to access the other option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant