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

894 ///
895 /// See: <https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-break_stmt>
896 fn parse_break_statement(&mut self) -> ast::StmtBreak {
897 let start = self.node_start();
898 self.bump(TokenKind::Break);
899 ast::StmtBreak {
900 range: self.node_range(start),
901 node_index: AtomicNodeIndex::NONE,
902 }
903 }
904
905 /// Parses an `assert` statement.
906 ///

Callers 1

Calls 3

node_startMethod · 0.80
node_rangeMethod · 0.80
bumpMethod · 0.45

Tested by

no test coverage detected