MCPcopy Index your code
hub / github.com/RustPython/RustPython / parse_str

Function parse_str

crates/derive-impl/src/compile_bytecode.rs:320–329  ·  view source on GitHub ↗
(input: ParseStream<'_>)

Source from the content-addressed store, hash-verified

318}
319
320fn parse_str(input: ParseStream<'_>) -> ParseResult<LitStr> {
321 let span = input.span();
322 if input.peek(LitStr) {
323 input.parse()
324 } else if let Ok(mac) = input.parse::<Macro>() {
325 Ok(LitStr::new(&mac.tokens.to_string(), mac.span()))
326 } else {
327 Err(syn::Error::new(span, "Expected string or stringify macro"))
328 }
329}
330
331struct PyCompileArgs {
332 source: CompilationSource,

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
spanMethod · 0.80
to_stringMethod · 0.80
ErrClass · 0.50
peekMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected