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

Make json output more informative for functions. #6380

Closed
wants to merge 2 commits into from
Closed

Make json output more informative for functions. #6380

wants to merge 2 commits into from

Conversation

dhasenan
Copy link
Contributor

It now includes the attributes I was able to find as well as the return type, linkage, and purity.

This explicitly includes the return type because a function might be declared without an explicit
return type (eg int i; auto ref foo() { return i; }) and that results in a type in the json of
ref ().

It now includes the attributes I was able to find as well as the return type, linkage, and purity.

This explicitly includes the return type because a function might be declared without an explicit
return type (eg `int i; auto ref foo() { return i; }`) and that results in a type in the json of
`ref ()`.
Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks useful to me. Maybe two minor points:

  • I think it's worthwhile to use sth. like attrs or attributes to keep the JSON object clean and adjustable for future attributes.
  • Is it possible to output UDAs as well?

property("parameters", tf.parameters);
property("trust", tf.trust);
propertyBool("nothrow", tf.isnothrow);
propertyBool("nogc", tf.isnogc);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worthwhile to put these under attributes, especially considering that UDAs should also be part of the output.

@JinShil
Copy link
Contributor

JinShil commented Jan 8, 2018

@dhasenan Are you still interested in pursuing this?

@dlang-bot dlang-bot removed the stalled label Jan 8, 2018
Copy link
Member

@WalterBright WalterBright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reduce the size of the json output, I suggest outputting the boolean attributes only if they are true. The reader can infer if they are not present that they are false.

@timotheecour
Copy link
Contributor

timotheecour commented Feb 9, 2018

To reduce the size of the json output, I suggest outputting the boolean attributes only if they are true. The reader can infer if they are not present that they are false.

Using protocol buffers (eg https://github.com/msoucy/dproto) would reduce need for such hacks, and have many other advantages, primarily type/schema safety, better performance, ease of reading and writing.

@dhasenan dhasenan closed this Feb 9, 2018
@WalterBright
Copy link
Member

@dhasenan why did you close this?

@dhasenan
Copy link
Contributor Author

dhasenan commented Feb 9, 2018

Because I am not currently able to spend any time on it. It's over a year old and probably has merge errors.

@WalterBright
Copy link
Member

No problem. I'll see if someone else wants to pick it up.

@WalterBright WalterBright added the Phantom Zone Has value/information for future work, but closed for now label Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Rebase Needs Work Phantom Zone Has value/information for future work, but closed for now
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants