mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-13 16:15:07 +00:00
New Singleton
enum for PatternMatchSingleton
node (#8063)
## Summary This PR adds a new `Singleton` enum for the `PatternMatchSingleton` node. Earlier the node was using the `Constant` enum but the value for this pattern can only be either `None`, `True` or `False`. With the coming PR to remove the `Constant`, this node required a new type to fill in. This also has the benefit of narrowing the type down to only the possible values for the node as evident by the removal of `unreachable`. ## Test Plan Update the AST snapshots and run `cargo test`.
This commit is contained in:
parent
ee7d445ef5
commit
78bbf6d403
10 changed files with 70 additions and 28 deletions
|
@ -1,5 +1,5 @@
|
|||
// auto-generated: "lalrpop 0.20.0"
|
||||
// sha3: 01c7c57ce067fcf07c9a5450511cc48a2dd08cf821a5ff3b0f649e87d3c67022
|
||||
// sha3: 5c061590e81d6c0a6b543c9e8d8d30e7d7a44ed6b20f2ac72ca61a0e33d0e647
|
||||
use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
|
||||
use ruff_python_ast::{self as ast, Int, IpyEscapeKind};
|
||||
use crate::{
|
||||
|
@ -34346,7 +34346,7 @@ fn __action115<
|
|||
) -> ast::Pattern
|
||||
{
|
||||
ast::PatternMatchSingleton {
|
||||
value: ast::Constant::None,
|
||||
value: ast::Singleton::None,
|
||||
range: (location..end_location).into()
|
||||
}.into()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue