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

Hex in generated json #49

Closed
omasoud opened this issue Oct 6, 2021 · 2 comments
Closed

Hex in generated json #49

omasoud opened this issue Oct 6, 2021 · 2 comments

Comments

@omasoud
Copy link

omasoud commented Oct 6, 2021

json5 allows numbers to be have hexadecimal representation, but can it generate hexadecimal numbers (via dump/dumps)?

@dpranke
Copy link
Owner

dpranke commented Oct 6, 2021

Not currently, no.

@dpranke
Copy link
Owner

dpranke commented Aug 1, 2022

I'm going to close this, as hopefully the question was answered.

I'm not against implementing this in principle, but in practice it's not obvious to me how one would do this without either adding a flag to dump all numbers in hex (and it is not obvious how useful that would be) or having some way to dump things field-by-field, at which point you're probably better off writing your own dump-like function.

I can also sort of imagine a way one might implement this on top of a more powerful api/implementation like what we'd need to preserve comments (see issue #28): such an implementation could probably also preserve whether the number was decimal or hex and render the value back out in the same format.

@dpranke dpranke closed this as completed May 15, 2023
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

2 participants