Files
ruff/crates/ruff_python_parser
Charlie Marsh e7adf82ff0 Reuse parser name lookups when interning (#28399)
Use hashbrown's borrowed-entry insertion for long parser names so a
missing name reuses its lookup when it is inserted. Construct the
heap-backed `Name` only on a miss, while preserving the inline bypass
and shared allocations for repeated long names.
2026-09-07 19:00:20 -04:00
..
2026-09-03 12:36:42 -04:00

Ruff Python Parser

Ruff's Python parser is a hand-written recursive descent parser which can parse Python source code into an Abstract Syntax Tree (AST). It also utilizes the Pratt parsing technique to parse expressions with different precedence.

Try out the parser in the playground.

Contributing

Refer to the contributing guidelines to get started and GitHub issues with the parser label for issues that need help.

Versioning

This crate is an internal component of Ruff. The Rust API exposed here is unstable and will have frequent breaking changes.

This version (0.0.12) is a component of Ruff 0.16.6. The source can be found here.

See Ruff's crate versioning policy for details on versioning.