File tree 6 files changed +3
-95
lines changed
6 files changed +3
-95
lines changed Original file line number Diff line number Diff line change @@ -98,28 +98,6 @@ impl ResolveValue for ast::Expression {
98
98
expression : None ,
99
99
ref variants,
100
100
} => select_default ( variants) . and_then ( |variant| variant. value . to_value ( env) ) ,
101
- ast:: Expression :: SelectExpression {
102
- expression : Some ( box ast:: Expression :: MessageReference { ref id } ) ,
103
- ref variants,
104
- } => {
105
- let tags = env. ctx
106
- . get_message ( & id. name )
107
- . and_then ( |message| message. tags . as_ref ( ) ) ;
108
-
109
- if let Some ( tags) = tags {
110
- for variant in variants {
111
- if let ast:: VarKey :: Symbol ( ref symbol) = variant. key {
112
- for tag in tags. iter ( ) {
113
- if symbol. name == tag. name . name {
114
- return variant. value . to_value ( env) ;
115
- }
116
- }
117
- }
118
- }
119
- }
120
-
121
- select_default ( variants) . and_then ( |variant| variant. value . to_value ( env) )
122
- }
123
101
ast:: Expression :: SelectExpression {
124
102
ref expression,
125
103
ref variants,
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ pub struct Message {
22
22
pub id : Identifier ,
23
23
pub value : Option < Pattern > ,
24
24
pub attributes : Option < Vec < Attribute > > ,
25
- pub tags : Option < Vec < Tag > > ,
26
25
pub comment : Option < Comment > ,
27
26
}
28
27
@@ -80,11 +79,6 @@ pub struct Attribute {
80
79
pub value : Pattern ,
81
80
}
82
81
83
- #[ derive( Debug , PartialEq ) ]
84
- pub struct Tag {
85
- pub name : Symbol ,
86
- }
87
-
88
82
#[ derive( Debug , PartialEq ) ]
89
83
pub struct Variant {
90
84
pub key : VarKey ,
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ pub trait FTLParserStream<I> {
19
19
fn is_peek_next_line_variant_start ( & mut self ) -> bool ;
20
20
fn is_peek_next_line_attribute_start ( & mut self ) -> bool ;
21
21
fn is_peek_next_line_pattern ( & mut self ) -> bool ;
22
- fn is_peek_next_line_tag_start ( & mut self ) -> bool ;
23
22
fn skip_to_next_entry_start ( & mut self ) ;
24
23
fn take_id_start ( & mut self ) -> Result < char > ;
25
24
fn take_id_char ( & mut self ) -> Option < char > ;
@@ -183,8 +182,8 @@ where
183
182
return false ;
184
183
}
185
184
186
- if self . current_peek_is ( '}' ) || self . current_peek_is ( '.' ) || self . current_peek_is ( '# ' )
187
- || self . current_peek_is ( '[' ) || self . current_peek_is ( ' *')
185
+ if self . current_peek_is ( '}' ) || self . current_peek_is ( '.' ) || self . current_peek_is ( '[ ' )
186
+ || self . current_peek_is ( '*' )
188
187
{
189
188
self . reset_peek ( ) ;
190
189
return false ;
@@ -194,30 +193,6 @@ where
194
193
true
195
194
}
196
195
197
- fn is_peek_next_line_tag_start ( & mut self ) -> bool {
198
- if !self . current_peek_is ( '\n' ) {
199
- return false ;
200
- }
201
- self . peek ( ) ;
202
-
203
- let ptr = self . get_peek_index ( ) ;
204
-
205
- self . peek_line_ws ( ) ;
206
-
207
- if self . get_peek_index ( ) - ptr == 0 {
208
- self . reset_peek ( ) ;
209
- return false ;
210
- }
211
-
212
- if self . current_peek_is ( '#' ) {
213
- self . reset_peek ( ) ;
214
- return true ;
215
- }
216
-
217
- self . reset_peek ( ) ;
218
- false
219
- }
220
-
221
196
fn skip_to_next_entry_start ( & mut self ) {
222
197
while let Some ( _) = self . next ( ) {
223
198
if self . current_is ( '\n' ) && !self . peek_char_is ( '\n' )
Original file line number Diff line number Diff line change @@ -170,15 +170,6 @@ where
170
170
None
171
171
} ;
172
172
173
- let tags = if ps. is_peek_next_line_tag_start ( ) {
174
- if attributes. is_some ( ) {
175
- return error ! ( ErrorKind :: Generic ) ;
176
- }
177
- Some ( get_tags ( ps) ?)
178
- } else {
179
- None
180
- } ;
181
-
182
173
if pattern. is_none ( ) && attributes. is_none ( ) {
183
174
return error ! ( ErrorKind :: MissingField {
184
175
entry_id: id. name,
@@ -190,7 +181,6 @@ where
190
181
id,
191
182
value : pattern,
192
183
attributes,
193
- tags,
194
184
comment,
195
185
} ) )
196
186
}
@@ -232,28 +222,6 @@ where
232
222
Ok ( attributes)
233
223
}
234
224
235
- fn get_tags < I > ( ps : & mut ParserStream < I > ) -> Result < Vec < ast:: Tag > >
236
- where
237
- I : Iterator < Item = char > ,
238
- {
239
- let mut tags = vec ! [ ] ;
240
- loop {
241
- ps. expect_char ( '\n' ) ?;
242
- ps. skip_line_ws ( ) ;
243
-
244
- ps. expect_char ( '#' ) ?;
245
-
246
- let symbol = get_symbol ( ps) ?;
247
-
248
- tags. push ( ast:: Tag { name : symbol } ) ;
249
-
250
- if !ps. is_peek_next_line_tag_start ( ) {
251
- break ;
252
- }
253
- }
254
- Ok ( tags)
255
- }
256
-
257
225
fn get_identifier < I > ( ps : & mut ParserStream < I > ) -> Result < ast:: Identifier >
258
226
where
259
227
I : Iterator < Item = char > ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -240,6 +240,7 @@ baz-unknown =
240
240
}
241
241
242
242
#[ test]
243
+ #[ ignore]
243
244
fn select_expression_message_selector ( ) {
244
245
let mut ctx = MessageContext :: new ( & [ "x-testing" ] ) ;
245
246
You can’t perform that action at this time.
0 commit comments