diff --git a/queries/csharp.scm b/queries/csharp.scm index fd3bd2316c..edcaa5f7bd 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -255,7 +255,7 @@ ;;!! () => 2; ;;! ^ (lambda_expression - body: (_) @value @interior + body: (_) @value (#not-type? @value block initializer_expression) ) @_.domain diff --git a/queries/java.scm b/queries/java.scm index cb92110928..1ae73642f6 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -134,10 +134,6 @@ name: (_) @name @functionName ) @namedFunction @_.domain -;;!! ((value) -> true) -;;! ^^^^^^^^^^^^^^^ -(lambda_expression) @anonymousFunction - ;;!! "string" ;;! ^^^^^^^^ ( @@ -537,11 +533,15 @@ (_) @value ) @_.domain +;;!! ((value) -> true) +;;! ^^^^^^^^^^^^^^^ +(lambda_expression) @anonymousFunction + ;;!! str -> str.length > 0 ;;! ^^^^^^^^^^^^^^ ;;! --------------------- (lambda_expression - body: (_) @value @interior + body: (_) @value (#not-type? @value block) ) @_.domain diff --git a/queries/javascript.core.scm b/queries/javascript.core.scm index 37a89316f2..f44c46c808 100644 --- a/queries/javascript.core.scm +++ b/queries/javascript.core.scm @@ -457,7 +457,7 @@ ;;! ^ ;;! -------- (arrow_function - body: (_) @value @interior + body: (_) @value (#not-type? @value statement_block) ) @_.domain diff --git a/queries/python.scm b/queries/python.scm index ae53900ec0..42ca32c45e 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -406,12 +406,6 @@ function: (_) @functionCallee ) @_.domain -;;!! lambda _: pass -;;! ^^^^^^^^^^^^^^ -(lambda - body: (_) @interior -) @anonymousFunction @interior.domain - ;;!! match value: ;;! ^^^^^ (match_statement @@ -726,6 +720,10 @@ (#child-range! @argumentList 1 -2) ) @argumentList.domain @argumentOrParameter.iteration.domain +;;!! lambda _: pass +;;! ^^^^^^^^^^^^^^ +(lambda) @anonymousFunction + ;;!! lambda a, b: pass ;;! ^^^^ (lambda