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

Method parse

assert-struct-macros/src/pattern/regex.rs:64–73  ·  view source on GitHub ↗

Parses a Like pattern: `=~ expr` # Example Input ```text =~ r"pattern" =~ my_pattern =~ get_pattern() ``` This parses the `=~` operator followed by any expression.

(input: syn::parse::ParseStream)

Source from the content-addressed store, hash-verified

62 ///
63 /// This parses the `=~` operator followed by any expression.
64 fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
65 let _: Token![=] = input.parse()?;
66 let _: Token![~] = input.parse()?;
67 let expr = input.parse::<syn::Expr>()?;
68
69 Ok(PatternLike {
70 node_id: next_node_id(),
71 expr,
72 })
73 }
74}

Callers

nothing calls this directly

Calls 1

next_node_idFunction · 0.85

Tested by

no test coverage detected