From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/fluent-bundle/src/resolver/mod.rs | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 vendor/fluent-bundle/src/resolver/mod.rs (limited to 'vendor/fluent-bundle/src/resolver/mod.rs') diff --git a/vendor/fluent-bundle/src/resolver/mod.rs b/vendor/fluent-bundle/src/resolver/mod.rs new file mode 100644 index 000000000..f137bcc91 --- /dev/null +++ b/vendor/fluent-bundle/src/resolver/mod.rs @@ -0,0 +1,42 @@ +pub mod errors; +mod expression; +mod inline_expression; +mod pattern; +mod scope; + +pub use errors::ResolverError; +pub use scope::Scope; + +use std::borrow::Borrow; +use std::fmt; + +use crate::memoizer::MemoizerKind; +use crate::resource::FluentResource; +use crate::types::FluentValue; + +// Converts an AST node to a `FluentValue`. +pub(crate) trait ResolveValue { + fn resolve<'source, 'errors, R, M>( + &'source self, + scope: &mut Scope<'source, 'errors, R, M>, + ) -> FluentValue<'source> + where + R: Borrow, + M: MemoizerKind; +} + +pub(crate) trait WriteValue { + fn write<'source, 'errors, W, R, M>( + &'source self, + w: &mut W, + scope: &mut Scope<'source, 'errors, R, M>, + ) -> fmt::Result + where + W: fmt::Write, + R: Borrow, + M: MemoizerKind; + + fn write_error(&self, _w: &mut W) -> fmt::Result + where + W: fmt::Write; +} -- cgit v1.2.3