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:903–910  ·  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

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

Callers 1

Calls 3

node_startMethod · 0.80
node_rangeMethod · 0.80
bumpMethod · 0.45

Tested by

no test coverage detected