From 601552458993e3ef0b38164c67ba18ef5db129dc Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 10 Oct 2024 14:34:24 +0200 Subject: [PATCH] Rust: insert `FunctionOrMethodCallExpr` in annotations --- rust/schema/annotations.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index b4c647f2654..7fafb26bbb3 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -185,8 +185,15 @@ class _: ``` """ +class FunctionOrMethodCallExpr(Expr): + """ + A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. + """ + arg_list: optional["ArgList"] | child + attrs: list["Attr"] | child -@annotate(CallExpr) + +@annotate(CallExpr, replace_bases={Expr: FunctionOrMethodCallExpr}) class _: """ A function call expression. For example: @@ -197,9 +204,10 @@ class _: foo(1) = 4; ``` """ + arg_list: drop + attrs: drop - -@annotate(MethodCallExpr) +@annotate(MethodCallExpr, replace_bases={Expr: FunctionOrMethodCallExpr}) class _: """ A method call expression. For example: @@ -208,6 +216,8 @@ class _: x.foo::(42); ``` """ + arg_list: drop + attrs: drop @annotate(MatchArm)