-
Notifications
You must be signed in to change notification settings - Fork 10
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
A better API for handling input that has already been parsed #22
Comments
Do you think splitting |
Looking at the code for Simply exposing the Maybe the happy medium would be to do the digit -> number conversion in Naga, but let |
@youknowone What would you think of having
Adapting the tests is quite a lot of not-so-interesting work, so I thought I'd check here before proceeding. |
See #23 for what this might look like. |
There is this PR aldanor/fast-float-rust#25 for pub fn parse_from_parts<T: FastFloat, S: AsRef<[u8]>>(integral: S, fractional: S, exponent: i64, negative: bool) -> T; I'm not sure what's best here (for instance why is the exponent an What do you guys think about the following signature (it's similar to the initial proposal without the pub fn parse_from_parts_hexf64(negative: bool, integral: &str, fractional: &str, exponent: &str) -> f64; |
As to the suggested signature, here's why I moved away from It seems desirable that this new API should be suitable for use by the The thing about passing
This is a fair point. Not optimal. But as long as the function that consumes
|
What I had in mind is extracting parts of the original parse function that could run on substrings of the original input; then the original Regarding the separator, if we'd like to add that as part of the @jimblandy @youknowone what do you think? |
The Naga crate uses
hexf_parse
to handle hex float literals in WGSL. Our front end has already verified that the text conforms to WGSL's grammar for hex float literals, but since that grammar has subtle differences from this library's grammar, we have to useformat!
to reassemble the pieces into whatparse_hexf64
expects.It'd be nicer if this library could accept a struct like this:
The text was updated successfully, but these errors were encountered: