MCPcopy Create free account
hub / github.com/carllerche/assert-struct / parse

Method parse

assert-struct-macros/src/pattern/simple.rs:29–36  ·  view source on GitHub ↗

Parses a simple expression pattern. # Example Input ```text 42 "hello" true my_variable compute_value() ``` This parses any valid Rust expression except ranges (handled by PatternRange).

(input: syn::parse::ParseStream)

Source from the content-addressed store, hash-verified

27 ///
28 /// This parses any valid Rust expression except ranges (handled by PatternRange).
29 fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
30 let expr = input.parse::<syn::Expr>()?;
31
32 Ok(PatternSimple {
33 node_id: next_node_id(),
34 expr,
35 })
36 }
37}

Callers

nothing calls this directly

Calls 1

next_node_idFunction · 0.85

Tested by

no test coverage detected