ruff/crates/red_knot_python_semantic/src
Carl Meyer fb778ee38d
[red-knot] unify LoopState and saved_break_states (#16406)
We currently keep two separate pieces of state regarding the current
loop on `SemanticIndexBuilder`. One is an enum simply reflecting whether
we are currently inside a loop, and the other is the saved flow states
for `break` statements found in the current loop.

For adding loopy control flow, I'll need to add some additional loop
state (`continue` states, for example). Prepare for this by
consolidating our existing loop state into a single struct and
simplifying the API for pushing and popping a loop.

This is purely a refactor, so tests are not changed.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-02-26 22:31:13 +00:00
..
module_resolver Rename venv-path to python (#16347) 2025-02-24 19:41:06 +01:00
semantic_index [red-knot] unify LoopState and saved_break_states (#16406) 2025-02-26 22:31:13 +00:00
types [red-knot] fix non-callable reporting for unions (#16387) 2025-02-26 07:06:04 -08:00
util [red-knot] Improve ergonomics for the PySlice trait (#13983) 2024-10-29 20:40:59 +00:00
ast_node_ref.rs Remove Hash and Eq from AstNodeRef for types not implementing Eq or Hash (#16100) 2025-02-11 19:55:50 +01:00
db.rs Use ast::PythonVersion internally in the formatter and linter (#16170) 2025-02-18 12:03:13 -05:00
lib.rs [red-knot] Use arena-allocated association lists for narrowing constraints (#16306) 2025-02-25 10:58:56 -05:00
lint.rs Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
module_name.rs Bind top-most parent when importing nested module (#14946) 2024-12-16 16:15:40 -05:00
node_key.rs [red-knot] Use memory address as AST node key (#14317) 2024-11-13 14:35:54 +01:00
program.rs Rename venv-path to python (#16347) 2025-02-24 19:41:06 +01:00
python_platform.rs Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
semantic_index.rs [red-knot] Rename constraint to predicate (#16382) 2025-02-25 14:52:40 -05:00
semantic_model.rs [red-knot] Rename *_ty functions (#15617) 2025-01-22 09:06:56 +01:00
site_packages.rs Rename venv-path to python (#16347) 2025-02-24 19:41:06 +01:00
suppression.rs ruff_db: add "secondary" messages to Diagnostic trait 2025-02-19 08:24:19 -05:00
symbol.rs [red-knot] Rename constraint to predicate (#16382) 2025-02-25 14:52:40 -05:00
types.rs [red-knot] Correct modeling of dunder calls (#16368) 2025-02-25 20:38:15 +01:00
unpack.rs Update Salsa part 1 (#16340) 2025-02-24 09:35:21 +01:00