Improve FormatExprCall dummy (#5290)

This solves an instability when formatting cpython. It also introduces
another one, but i think it's still a worthwhile change for now.

There's no proper testing since this is just a dummy.
This commit is contained in:
konstin 2023-06-22 10:59:30 +02:00 committed by GitHub
parent 2c63f8cdea
commit 7d4f8e59da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 403 additions and 374 deletions

View file

@ -10,11 +10,20 @@ use rustpython_parser::ast::ExprCall;
pub struct FormatExprCall;
impl FormatNodeRule<ExprCall> for FormatExprCall {
fn fmt_fields(&self, _item: &ExprCall, f: &mut PyFormatter) -> FormatResult<()> {
write!(
f,
[not_yet_implemented_custom_text("NOT_IMPLEMENTED_call()")]
)
fn fmt_fields(&self, item: &ExprCall, f: &mut PyFormatter) -> FormatResult<()> {
if item.args.is_empty() && item.keywords.is_empty() {
write!(
f,
[not_yet_implemented_custom_text("NOT_IMPLEMENTED_call()")]
)
} else {
write!(
f,
[not_yet_implemented_custom_text(
"NOT_IMPLEMENTED_call(NOT_IMPLEMENTED_arg)"
)]
)
}
}
}