mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-13 22:06:42 +00:00
Move ExprConstant::kind
to StringConstant::unicode
(#7180)
This commit is contained in:
parent
31990b8d3f
commit
04f2842e4f
119 changed files with 130 additions and 504 deletions
|
@ -945,7 +945,6 @@ impl From<ExprFString> for Expr {
|
|||
pub struct ExprConstant {
|
||||
pub range: TextRange,
|
||||
pub value: Constant,
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl From<ExprConstant> for Expr {
|
||||
|
@ -2559,6 +2558,8 @@ pub struct StringConstant {
|
|||
/// The string value as resolved by the parser (i.e., without quotes, or escape sequences, or
|
||||
/// implicit concatenations).
|
||||
pub value: String,
|
||||
/// Whether the string is a Unicode string (i.e., `u"..."`).
|
||||
pub unicode: bool,
|
||||
/// Whether the string contains multiple string tokens that were implicitly concatenated.
|
||||
pub implicit_concatenated: bool,
|
||||
}
|
||||
|
@ -2598,6 +2599,7 @@ impl From<String> for Constant {
|
|||
fn from(value: String) -> Constant {
|
||||
Self::Str(StringConstant {
|
||||
value,
|
||||
unicode: false,
|
||||
implicit_concatenated: false,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue