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

Method parse_literal_pattern

parser/src/parser/parser.rs:890–897  ·  view source on GitHub ↗

https://docs.python.org/3/reference/compound_stmts.html#literal-patterns

(&mut self)

Source from the content-addressed store, hash-verified

888
889 // https://docs.python.org/3/reference/compound_stmts.html#literal-patterns
890 fn parse_literal_pattern(&mut self) -> Result<MatchPattern, ParsingError> {
891 let node = self.start_node();
892 let value = self.parse_binary_arithmetic_operation(0)?;
893 Ok(MatchPattern::MatchValue(MatchValue {
894 node: self.finish_node(node),
895 value,
896 }))
897 }
898
899 fn parse_capture_or_wildcard_pattern(&mut self) -> Result<MatchPattern, ParsingError> {
900 let capture_value = self.cur_token().to_string(self.source);

Callers 2

parse_closed_patternMethod · 0.80

Calls 4

MatchValueClass · 0.85
start_nodeMethod · 0.80
finish_nodeMethod · 0.80

Tested by

no test coverage detected