We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b4eb16 commit 77eb38aCopy full SHA for 77eb38a
fluent-bundle/src/builtins.rs
@@ -0,0 +1,14 @@
1
+use crate::{FluentArgs, FluentValue};
2
+
3
+#[allow(non_snake_case)]
4
+pub fn NUMBER<'a>(positional: &[FluentValue<'a>], named: &FluentArgs) -> FluentValue<'a> {
5
+ let Some(FluentValue::Number(n)) = positional.first() else {
6
+ return FluentValue::Error;
7
+ };
8
9
+ let mut n = n.clone();
10
+ n.options.merge(named);
11
+ println!("{named:?} => {n:?}");
12
13
+ FluentValue::Number(n)
14
+}
fluent-bundle/src/lib.rs
@@ -110,6 +110,7 @@ mod message;
110
pub mod resolver;
111
mod resource;
112
pub mod types;
113
+pub mod builtins;
114
115
pub use args::FluentArgs;
116
/// Specialized [`FluentBundle`](crate::bundle::FluentBundle) over
0 commit comments