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

Method parse_break_statement

crates/ruff_python_parser/src/parser/statement.rs:908–915  ·  view source on GitHub ↗

Parses a `break` statement. # Panics If the parser isn't positioned at a `break` token. See:

(&mut self)

Source from the content-addressed store, hash-verified

906 ///
907 /// See: <https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-break_stmt>
908 fn parse_break_statement(&mut self) -> ast::StmtBreak {
909 let start = self.node_start();
910 self.bump(TokenKind::Break);
911 ast::StmtBreak {
912 range: self.node_range(start),
913 node_index: AtomicNodeIndex::NONE,
914 }
915 }
916
917 /// Parses an `assert` statement.
918 ///

Callers 1

Calls 3

node_startMethod · 0.80
node_rangeMethod · 0.80
bumpMethod · 0.45

Tested by

no test coverage detected