MCPcopy Create free account
hub / github.com/Glyphack/enderpy / parse_value_pattern

Method parse_value_pattern

parser/src/parser/parser.rs:923–932  ·  view source on GitHub ↗

https://docs.python.org/3/reference/compound_stmts.html#value-patterns This pattern shares the value logic with class pattern so we pass that part to this method

(
        &mut self,
        value: Expression,
        node: Node,
    )

Source from the content-addressed store, hash-verified

921 // This pattern shares the value logic with class pattern
922 // so we pass that part to this method
923 fn parse_value_pattern(
924 &mut self,
925 value: Expression,
926 node: Node,
927 ) -> Result<MatchPattern, ParsingError> {
928 Ok(MatchPattern::MatchValue(MatchValue {
929 node: self.finish_node(node),
930 value,
931 }))
932 }
933
934 // This parse attr does not allow anything other than names
935 // in contrast to attribute parsing in primary expression

Callers 2

parse_closed_patternMethod · 0.80

Calls 2

MatchValueClass · 0.85
finish_nodeMethod · 0.80

Tested by

no test coverage detected