commit 36f13a449d515d4d3a0856ff07491f6b177c4222 parent 6b64c2f1e7fc425bafe6c4ee53dfe410c4dea33c Author: Jacob R. Edwards <jacobouno@protonmail.com> Date: Wed, 21 Jul 2021 22:43:45 -0700 Add cnoname script This script is for use with cdec, it removes parameter names from function declarations. Diffstat:
| A | local/bin/.local/bin/cnoname | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/local/bin/.local/bin/cnoname b/local/bin/.local/bin/cnoname @@ -0,0 +1,11 @@ +#!/usr/bin/sed -Ef +# Copyright 2021 Jacob R. Edwards +# License: GPLv3 +# Remove parameter names from C function declarations +# +# NOTE: Excepting the void type, if it is already nameless the type +# itself will be eaten away. This could be avoided with extra +# processing but seems a minor issue. + +s/void([,)])/void void\1/g +s/[ ]*[A-Z_a-z][0-9A-Z_a-z]*([,)])/\1/g