-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add NUMBER builtin function #353
Conversation
Will review, but definitely waiting on #347 before we can actually do anything about this ;-) Thanks for taking the time to contribute. |
67a5f46
to
a3a63c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase and change the derivation of Default
once #356 lands.
Are there other tests that should be added?
I was reviewing this and went ahead and rebased to fix the commit messages and also threw in the |
A couple of notes: In #259, @gregtatum mentioned using Also, https://projectfluent.org/fluent/guide/functions.html#number lists a number of other options. Should any of them be supported as part of this? (or a follow-up issue filed to track that they're missing?) |
I changed that back because I wanted to avoid using a different term in Rust than is used everywhere else.
Those should already be handled here:
|
I would have preferred "kind" too, but given that the Guide and Python both already use "type" I do agree that we should stick with that for now. If changing this is a priority we should hurry up and suggest the fix in the guide and spec, then implement it that way in Rust and Python can take their time about adapting. Honestly I'm not sure it's worth it just to avoid a reserved word we can easily use raw strings for anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm on board with this and most discussion is resolved, but I have to agree with this one:
Are there other tests that should be added?
How is this getting tested?
There's a doctest, I can add integration tests too if desired. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw the example in the docstring but I'd missed the output in the test run. I just confirmed it is there and don't know specifically what else, if anything, would need a test.
Back to you @waywardmonkeys. Was there something else specific you thought should be tested? |
I'd probably go with something like the Python tests: https://github.com/projectfluent/python-fluent/pull/193/files#diff-30d1a24a3e67774b5d192acb1cd3f532961bae49746db23ab7b7962e7cb8a25d |
Head branch was pushed to by a user without write access
I've added an integration test. |
Make early lints translatable <del>Requires https://github.com/projectfluent/fluent-rs/pull/353.</del> rust-lang@5134a04 r? diagnostics
I just tried Also This is all a bit confusing, especially with #19 and #313 closed as completed. UPD: I didn't call |
Followup to #259. Adds the
type
property toFluentNumberOptions
and makes it available through a newNUMBER()
built-in fluent function. Built-ins (currently justNUMBER()
) are added to the bundle usingFluentBundle::add_builtins()
.Cc #19.