1 | pub mod errors; |
2 | mod expression; |
3 | mod inline_expression; |
4 | mod pattern; |
5 | mod scope; |
6 | |
7 | pub use errors::ResolverError; |
8 | pub use scope::Scope; |
9 | |
10 | use std::borrow::Borrow; |
11 | use std::fmt; |
12 | |
13 | use crate::memoizer::MemoizerKind; |
14 | use crate::resource::FluentResource; |
15 | use crate::types::FluentValue; |
16 | |
17 | // Converts an AST node to a `FluentValue`. |
18 | pub(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 | |
28 | pub(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 | |