Files
ruff/crates/ruff_python_parser
Micha Reiser 4bee772ff2 Use Vec for the source-ordered parameter list
With all parameter roles sharing one list, the length can live next to the range and node index without growing Stmt or Expr. Parameters remains smaller than the previous multi-list representation (40 vs. 56 bytes on x86-64).
2026-11-22 13:55:35 +00:00
..
2026-11-19 10:32:47 -05:00
2026-11-19 10:32:47 -05: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.23) is a component of Ruff 0.17.6. The source can be found here.

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