@@ -71,7 +71,7 @@ func (s *CTagsParser) Run(context map[string]interface{}) error {
7171 tags = filterOutUnknownTags (tags )
7272 tags = filterOutTagsWithField (tags , FIELD_CLASS )
7373 tags = filterOutTagsWithField (tags , FIELD_STRUCT )
74- tags = markTagsWithFunctionWithDefaultArgs (tags )
74+ tags = skipTagsWhere (tags , signatureContainsDefaultArg )
7575 tags = addPrototypes (tags )
7676 tags = removeDefinedProtypes (tags )
7777 tags = removeDuplicate (tags )
@@ -153,13 +153,23 @@ func removeDuplicate(tags []map[string]string) []map[string]string {
153153 return newTags
154154}
155155
156- func markTagsWithFunctionWithDefaultArgs (tags []map [string ]string ) []map [string ]string {
156+ type skipFuncType func (tag map [string ]string ) bool
157+
158+ func skipTagsWhere (tags []map [string ]string , skipFuncs ... skipFuncType ) []map [string ]string {
157159 for _ , tag := range tags {
158- tag [FIELD_SKIP ] = strconv .FormatBool (strings .Contains (tag [FIELD_SIGNATURE ], "=" ))
160+ skip := skipFuncs [0 ](tag )
161+ for _ , skipFunc := range skipFuncs [1 :] {
162+ skip = skip || skipFunc (tag )
163+ }
164+ tag [FIELD_SKIP ] = strconv .FormatBool (skip )
159165 }
160166 return tags
161167}
162168
169+ func signatureContainsDefaultArg (tag map [string ]string ) bool {
170+ return strings .Contains (tag [FIELD_SIGNATURE ], "=" )
171+ }
172+
163173func filterOutTagsWithField (tags []map [string ]string , field string ) []map [string ]string {
164174 var newTags []map [string ]string
165175 for _ , tag := range tags {
0 commit comments