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

Define number parsing #189

Open
domenic opened this issue Jan 23, 2018 · 2 comments
Open

Define number parsing #189

domenic opened this issue Jan 23, 2018 · 2 comments

Comments

@domenic
Copy link
Member

domenic commented Jan 23, 2018

There are multiple number parsing algorithms on the platform:

It seems ideal to me if at least some of these could be shared. Maybe just between JSON and CSS, and HTML has extensions to it? I need to audit the potential differences.

@tabatkins
Copy link
Contributor

Note: CSS and JSON also allow exponential notation (1e2 for 100, etc) in exactly the same way.

@tabatkins
Copy link
Contributor

tabatkins commented Jan 23, 2018

Ah, I lied - JSON and CSS are not completely identical. Per the JSON.org diagram, JSON does not allow unnecessary leading zeros (02.3 is disallowed) (besides the leading 0 in 0.XXX forms), and JSON doesn't allow a fraction without an integer part (the .XXX form).

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

No branches or pull requests

2 participants