coccinelle: simplify variable declaractions in rules from the_repository.pending.cocci
diff mbox series

Message ID c260ef87-21d6-8fbc-8060-d7d1c6330601@web.de
State New
Headers show
Series
  • coccinelle: simplify variable declaractions in rules from the_repository.pending.cocci
Related show

Commit Message

Markus Elfring Nov. 12, 2019, 9 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 12 Nov 2019 21:55:18 +0100

This script contained some transformation rules for the semantic patch language
where a few metavariables were declared with the same type “expression”.
Reduce duplicate SmPL code just by listing the desired variable names
directly behind the type specification.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 .../coccinelle/the_repository.pending.cocci   | 44 +++++--------------
 1 file changed, 12 insertions(+), 32 deletions(-)

--
2.24.0

Patch
diff mbox series

diff --git a/contrib/coccinelle/the_repository.pending.cocci b/contrib/coccinelle/the_repository.pending.cocci
index 2ee702ecf7..697e8fc77b 100644
--- a/contrib/coccinelle/the_repository.pending.cocci
+++ b/contrib/coccinelle/the_repository.pending.cocci
@@ -3,9 +3,7 @@ 
 // our code base.

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - read_object_file(
 + repo_read_object_file(the_repository,
@@ -42,17 +40,14 @@  expression F;
   E)

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - parse_commit_internal(
 + repo_parse_commit_internal(the_repository,
   E, F, G)

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - parse_commit_gently(
 + repo_parse_commit_gently(the_repository,
@@ -66,78 +61,63 @@  expression E;
   E)

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - get_merge_bases(
 + repo_get_merge_bases(the_repository,
   E, F);

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - get_merge_bases_many(
 + repo_get_merge_bases_many(the_repository,
   E, F, G);

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - get_merge_bases_many_dirty(
 + repo_get_merge_bases_many_dirty(the_repository,
   E, F, G);

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - in_merge_bases(
 + repo_in_merge_bases(the_repository,
   E, F);

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - in_merge_bases_many(
 + repo_in_merge_bases_many(the_repository,
   E, F, G);

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - get_commit_buffer(
 + repo_get_commit_buffer(the_repository,
   E, F);

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - unuse_commit_buffer(
 + repo_unuse_commit_buffer(the_repository,
   E, F);

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - logmsg_reencode(
 + repo_logmsg_reencode(the_repository,
   E, F, G);

 @@
-expression E;
-expression F;
-expression G;
-expression H;
+expression E, F, G, H;
 @@
 - format_commit_message(
 + repo_format_commit_message(the_repository,