-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Inspired by https://docs.rs/pmutil/latest/pmutil/macro.smart_quote.html
e.g.
ExprKind::Tuple(ast::ExprTuple {
elts: names
.iter()
.map(|&name| {
create_expr(ExprKind::Constant(
ast::ExprConstant {
value: Constant::Str(name.to_string()),
kind: None,
},
))
})
.collect(),
ctx: ExprContext::Load,
}))
can be rewritten to:
&python_ast! {
Vars { names },
"(*names)"
}
The grammar will be limited to legal python codes to leverage python parser.
Metadata
Metadata
Assignees
Labels
No labels