diff --git a/crates/message/src/formatter.rs b/crates/message/src/formatter.rs index 96baa53..2478a99 100644 --- a/crates/message/src/formatter.rs +++ b/crates/message/src/formatter.rs @@ -14,7 +14,7 @@ use std::rc::Rc; use i18n_lstring::LString; use i18n_lexer::{Lexer, Token, TokenType}; use tree::{Tree, NodeFeatures}; -use i18n_pattern::{NodeType, parse}; +use i18n_pattern::{ParserResult, NodeType}; use std::collections::HashMap; //use std::fmt; this is needed if implementing Display on something @@ -24,20 +24,20 @@ pub struct System { impl System { pub fn try_new( lexer: Lexer ) -> Result { - + Err( "Temporary error until implemented.".to_string() ) } } pub struct Formatter { locale: Rc, - ast: Tree, + parser_result: ParserResult, } impl Formatter { - /// Creates a Formatter for the language string. - pub fn try_new( string: LString ) -> Result { - Err( "Temporary error until implemented.".to_string() ) + /// Creates a Formatter for the language string using parsing results. + pub fn try_new( locale: Rc, parser_result: ParserResult ) -> Self { + Formatter { locale, parser_result } } /// Format the language string with supplied values.