mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
Use CompactString
for Identifier
(#12101)
This commit is contained in:
parent
db6ee74cbe
commit
5109b50bb3
474 changed files with 4953 additions and 4776 deletions
|
@ -1,3 +1,4 @@
|
|||
use ruff_python_ast::name::Name;
|
||||
use ruff_python_ast::{self as ast, Expr, ExprContext, Number, Operator, Pattern, Singleton};
|
||||
use ruff_text_size::{Ranged, TextSize};
|
||||
|
||||
|
@ -510,7 +511,7 @@ impl<'src> Parser<'src> {
|
|||
);
|
||||
let invalid_node = Expr::Name(ast::ExprName {
|
||||
range: self.missing_node_range(),
|
||||
id: String::new(),
|
||||
id: Name::empty(),
|
||||
ctx: ExprContext::Invalid,
|
||||
});
|
||||
Pattern::MatchValue(ast::PatternMatchValue {
|
||||
|
@ -616,7 +617,7 @@ impl<'src> Parser<'src> {
|
|||
} else {
|
||||
Box::new(Expr::Name(ast::ExprName {
|
||||
range: ident.range(),
|
||||
id: String::new(),
|
||||
id: Name::empty(),
|
||||
ctx: ExprContext::Invalid,
|
||||
}))
|
||||
}
|
||||
|
@ -667,7 +668,7 @@ impl<'src> Parser<'src> {
|
|||
&pattern,
|
||||
);
|
||||
ast::Identifier {
|
||||
id: String::new(),
|
||||
id: Name::empty(),
|
||||
range: parser.missing_node_range(),
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue