1pub mod errors;
2mod expression;
3mod inline_expression;
4mod pattern;
5mod scope;
6
7pub use errors::ResolverError;
8pub use scope::Scope;
9
10use std::borrow::Borrow;
11use std::fmt;
12
13use crate::memoizer::MemoizerKind;
14use crate::resource::FluentResource;
15use crate::types::FluentValue;
16
17// Converts an AST node to a `FluentValue`.
18pub(crate) trait ResolveValue {
19 fn resolve<'source, 'errors, R, M>(
20 &'source self,
21 scope: &mut Scope<'source, 'errors, R, M>,
22 ) -> FluentValue<'source>
23 where
24 R: Borrow<FluentResource>,
25 M: MemoizerKind;
26}
27
28pub(crate) trait WriteValue {
29 fn write<'source, 'errors, W, R, M>(
30 &'source self,
31 w: &mut W,
32 scope: &mut Scope<'source, 'errors, R, M>,
33 ) -> fmt::Result
34 where
35 W: fmt::Write,
36 R: Borrow<FluentResource>,
37 M: MemoizerKind;
38
39 fn write_error<W>(&self, _w: &mut W) -> fmt::Result
40 where
41 W: fmt::Write;
42}
43