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

Method compile_pattern

crates/codegen/src/compile.rs:6765–6796  ·  view source on GitHub ↗
(
        &mut self,
        pattern_type: &ast::Pattern,
        pattern_context: &mut PatternContext,
    )

Source from the content-addressed store, hash-verified

6763 }
6764
6765 fn compile_pattern(
6766 &mut self,
6767 pattern_type: &ast::Pattern,
6768 pattern_context: &mut PatternContext,
6769 ) -> CompileResult<()> {
6770 match &pattern_type {
6771 ast::Pattern::MatchValue(pattern_type) => {
6772 self.compile_pattern_value(pattern_type, pattern_context)
6773 }
6774 ast::Pattern::MatchSingleton(pattern_type) => {
6775 self.compile_pattern_singleton(pattern_type, pattern_context)
6776 }
6777 ast::Pattern::MatchSequence(pattern_type) => {
6778 self.compile_pattern_sequence(pattern_type, pattern_context)
6779 }
6780 ast::Pattern::MatchMapping(pattern_type) => {
6781 self.compile_pattern_mapping(pattern_type, pattern_context)
6782 }
6783 ast::Pattern::MatchClass(pattern_type) => {
6784 self.compile_pattern_class(pattern_type, pattern_context)
6785 }
6786 ast::Pattern::MatchStar(pattern_type) => {
6787 self.compile_pattern_star(pattern_type, pattern_context)
6788 }
6789 ast::Pattern::MatchAs(pattern_type) => {
6790 self.compile_pattern_as(pattern_type, pattern_context)
6791 }
6792 ast::Pattern::MatchOr(pattern_type) => {
6793 self.compile_pattern_or(pattern_type, pattern_context)
6794 }
6795 }
6796 }
6797
6798 fn compile_match_inner(
6799 &mut self,

Callers 4

compile_pattern_asMethod · 0.80
compile_pattern_orMethod · 0.80
compile_match_innerMethod · 0.80

Calls 8

compile_pattern_valueMethod · 0.80
compile_pattern_classMethod · 0.80
compile_pattern_starMethod · 0.80
compile_pattern_asMethod · 0.80
compile_pattern_orMethod · 0.80

Tested by

no test coverage detected