diff options
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c index 7ee8843..e01dd0d 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -345,6 +345,9 @@ validate_expr(expr_ty exp, expr_context_ty ctx) case JoinedStr_kind: ret = validate_exprs(exp->v.JoinedStr.values, Load, 0); break; + case TemplateStr_kind: + ret = validate_exprs(exp->v.TemplateStr.values, Load, 0); + break; case FormattedValue_kind: if (validate_expr(exp->v.FormattedValue.value, Load) == 0) return 0; @@ -354,6 +357,15 @@ validate_expr(expr_ty exp, expr_context_ty ctx) } ret = 1; break; + case Interpolation_kind: + if (validate_expr(exp->v.Interpolation.value, Load) == 0) + return 0; + if (exp->v.Interpolation.format_spec) { + ret = validate_expr(exp->v.Interpolation.format_spec, Load); + break; + } + ret = 1; + break; case Attribute_kind: ret = validate_expr(exp->v.Attribute.value, Load); break; @@ -512,6 +524,7 @@ validate_pattern_match_value(expr_ty exp) } break; case JoinedStr_kind: + case TemplateStr_kind: // Handled in the later stages return 1; default: |