MCPcopy Create free account
hub / github.com/astral-sh/ruff / at_pattern_start

Method at_pattern_start

crates/ruff_python_parser/src/parser/pattern.rs:57–59  ·  view source on GitHub ↗

Returns `true` if the current token is a valid start of a pattern.

(&self)

Source from the content-addressed store, hash-verified

55impl Parser<'_> {
56 /// Returns `true` if the current token is a valid start of a pattern.
57 pub(super) fn at_pattern_start(&self) -> bool {
58 self.at_ts(PATTERN_START_SET) || self.at_soft_keyword()
59 }
60
61 /// Returns `true` if the current token is a valid start of a mapping pattern.
62 pub(super) fn at_mapping_pattern_start(&self) -> bool {

Callers 1

is_list_elementMethod · 0.80

Calls 2

at_tsMethod · 0.80
at_soft_keywordMethod · 0.80

Tested by

no test coverage detected