process all the args of a function Start state: after '(' End state: on ')'
(
rules_with_context: &'r mut SpeechRulesWithContext<'c,'s,'m>,
lex_state: &mut LexState<'b>,
mathml: Element<'c>)
| 329 | // Start state: after '(' |
| 330 | // End state: on ')' |
| 331 | fn build_arguments<'b, 'r, 'c, 's:'c, 'm:'c>( |
| 332 | rules_with_context: &'r mut SpeechRulesWithContext<'c,'s,'m>, |
| 333 | lex_state: &mut LexState<'b>, |
| 334 | mathml: Element<'c>) -> Result<Vec<Element<'m>>> { |
| 335 | // arguments := intent ( ',' intent )*' |
| 336 | // debug!(" start build_args state: {}", lex_state); |
| 337 | |
| 338 | // there is at least one arg |
| 339 | let mut children = Vec::with_capacity(lex_state.remaining_str.len()/3 + 1); // conservative estimate ('3' - "$x,"); |
| 340 | children.push( build_intent(rules_with_context, lex_state, mathml)? ); // arg before ',' |
| 341 | // debug!(" build_args: # children {}; state: {}", children.len(), lex_state); |
| 342 | |
| 343 | while lex_state.is_terminal(",") { |
| 344 | lex_state.get_next()?; |
| 345 | children.push( build_intent(rules_with_context, lex_state, mathml)? ); // arg before ',' |
| 346 | // debug!(" build_args, # children {}; state: {}", children.len(), lex_state); |
| 347 | } |
| 348 | |
| 349 | // debug!(" end build_args, # children {}; state: {}", children.len(), lex_state); |
| 350 | return Ok(children); |
| 351 | } |
| 352 | |
| 353 | /// lift the children up to LITERAL_NAME |
| 354 | fn lift_function_name<'m>(doc: Document<'m>, function_name: Element<'m>, children: Vec<Element<'m>>) -> Element<'m> { |
no test coverage detected