MCPcopy Create free account
hub / github.com/daisy/MathCAT / get_properties

Function get_properties

src/infer_intent.rs:276–291  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

274/// Get all the properties, stopping we don't have any more
275/// Returns the string of the properties terminated with an additional ":"
276fn 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///

Callers 1

build_intentFunction · 0.85

Calls 3

as_strMethod · 0.80
get_nextMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected