Get all the properties, stopping we don't have any more Returns the string of the properties terminated with an additional ":"
(lex_state: &mut LexState)
| 274 | /// Get all the properties, stopping we don't have any more |
| 275 | /// Returns the string of the properties terminated with an additional ":" |
| 276 | fn get_properties(lex_state: &mut LexState) -> Result<String> { |
| 277 | // return the 'hint' leaving the state |
| 278 | assert!(matches!(lex_state.token, Token::Property(str) if str.starts_with(':'))); |
| 279 | let mut properties = String::with_capacity(60); |
| 280 | properties.push_str(lex_state.token.as_str()); |
| 281 | loop { |
| 282 | let token = lex_state.get_next()?; |
| 283 | if let Token::Property(property) = token { |
| 284 | properties.push_str(property); |
| 285 | } else { |
| 286 | properties.push(':'); |
| 287 | // debug!(" get_properties: returns {}", properties); |
| 288 | return Ok(properties); |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | /// Build a function 'f(...)' where '...' can be empty |
| 294 | /// |
no test coverage detected