1
+ //! The `resolver` module contains the definitions and implementations for the internal
2
+ //! `ResolveValue` and `WriteValue` traits. The former converts AST nodes to a
3
+ //! [`FluentValue`], and the latter converts them to a string that is written to an
4
+ //! implementor of the [`std::fmt::Write`] trait.
5
+
1
6
pub mod errors;
2
7
mod expression;
3
8
mod inline_expression;
@@ -14,8 +19,9 @@ use crate::memoizer::MemoizerKind;
14
19
use crate :: resource:: FluentResource ;
15
20
use crate :: types:: FluentValue ;
16
21
17
- // Converts an AST node to a `FluentValue`.
22
+ /// Resolves an AST node to a [ `FluentValue`] .
18
23
pub ( crate ) trait ResolveValue < ' bundle > {
24
+ /// Resolves an AST node to a [`FluentValue`].
19
25
fn resolve < ' ast , ' args , ' errors , R , M > (
20
26
& ' ast self ,
21
27
scope : & mut Scope < ' bundle , ' ast , ' args , ' errors , R , M > ,
@@ -25,7 +31,9 @@ pub(crate) trait ResolveValue<'bundle> {
25
31
M : MemoizerKind ;
26
32
}
27
33
34
+ /// Resolves an AST node to a string that is written to source `W`.
28
35
pub ( crate ) trait WriteValue < ' bundle > {
36
+ /// Resolves an AST node to a string that is written to source `W`.
29
37
fn write < ' ast , ' args , ' errors , W , R , M > (
30
38
& ' ast self ,
31
39
w : & mut W ,
@@ -36,6 +44,8 @@ pub(crate) trait WriteValue<'bundle> {
36
44
R : Borrow < FluentResource > ,
37
45
M : MemoizerKind ;
38
46
47
+ /// Writes error information to `W`. This can be used to add FTL errors inline
48
+ /// to a message.
39
49
fn write_error < W > ( & self , _w : & mut W ) -> fmt:: Result
40
50
where
41
51
W : fmt:: Write ;
0 commit comments