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

support parse number with high precision as possible in sonic ast #448

Open
liuq19 opened this issue Jun 6, 2023 · 3 comments
Open

support parse number with high precision as possible in sonic ast #448

liuq19 opened this issue Jun 6, 2023 · 3 comments
Labels
good first issue Good for newcomers

Comments

@liuq19
Copy link
Collaborator

liuq19 commented Jun 6, 2023

Support parse number with high precision as possible.

For example:

  1. If number is negative integer, parse number into int64,
  2. If number is positive integer, parse number into uint64,
  3. Others, parse number into float64.

Now usenumber only cast number to json.Number, it is string type. Also, ast not have UseInt64 API. So we can provide a new API, to do it.

@liuq19 liuq19 changed the title support high precision as possible in sonic support high precision as possible in sonic ast Jun 6, 2023
@liuq19 liuq19 changed the title support high precision as possible in sonic ast support parse number with high precision as possible in sonic ast Jun 6, 2023
@liuq19 liuq19 added the good first issue Good for newcomers label Jun 6, 2023
@chenlinli
Copy link

Will the new API be supported?

@AsterDY
Copy link
Collaborator

AsterDY commented Jun 7, 2023

sonic.UseInt64.UnmarshalString(node.Raw(), map{}) can work around for first-touched node (not trigger node.Get()|Set() yet)

@chenlinli
Copy link

chenlinli commented Jun 7, 2023 via email

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

No branches or pull requests

3 participants