ruff/crates/ruff_python_parser/src
Charlie Marsh 8a0f844642
Box type params and arguments fields on the class definition node (#6275)
## Summary

This PR boxes the `TypeParams` and `Arguments` fields on the class
definition node. These fields are optional and often emitted, and given
that class definition is our largest enum variant, we pay the cost of
including them for every statement in the AST. Boxing these types
reduces the statement size by 40 bytes, which seems like a good tradeoff
given how infrequently these are accessed.

## Test Plan

Need to benchmark, but no behavior changes.
2023-08-02 16:47:06 +00:00
..
lexer Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
snapshots Add a TypeParams node to the AST (#6261) 2023-08-02 14:12:45 +00:00
context.rs Remove Parse trait (#6235) 2023-08-01 18:35:03 +02:00
function.rs Introduce an Arguments AST node for function calls and class definitions (#6259) 2023-08-02 10:01:13 -04:00
lexer.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
lib.rs Remove Parse trait (#6235) 2023-08-01 18:35:03 +02:00
parser.rs Remove Parse trait (#6235) 2023-08-01 18:35:03 +02:00
python.lalrpop Box type params and arguments fields on the class definition node (#6275) 2023-08-02 16:47:06 +00:00
python.rs Box type params and arguments fields on the class definition node (#6275) 2023-08-02 16:47:06 +00:00
soft_keywords.rs Replace .map_or(false, $closure) with .is_some_and(closure) (#6244) 2023-08-01 19:29:42 +02:00
string.rs Remove Parse trait (#6235) 2023-08-01 18:35:03 +02:00
token.rs Remove unused parser modes 2023-08-01 13:10:07 +02:00
typing.rs Replace .map_or(false, $closure) with .is_some_and(closure) (#6244) 2023-08-01 19:29:42 +02:00