@@ -71,7 +71,7 @@ func (s *CTagsParser) Run(context map[string]interface{}) error {
71
71
tags = filterOutUnknownTags (tags )
72
72
tags = filterOutTagsWithField (tags , FIELD_CLASS )
73
73
tags = filterOutTagsWithField (tags , FIELD_STRUCT )
74
- tags = markTagsWithFunctionWithDefaultArgs (tags )
74
+ tags = skipTagsWhere (tags , signatureContainsDefaultArg )
75
75
tags = addPrototypes (tags )
76
76
tags = removeDefinedProtypes (tags )
77
77
tags = removeDuplicate (tags )
@@ -153,13 +153,23 @@ func removeDuplicate(tags []map[string]string) []map[string]string {
153
153
return newTags
154
154
}
155
155
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 {
157
159
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 )
159
165
}
160
166
return tags
161
167
}
162
168
169
+ func signatureContainsDefaultArg (tag map [string ]string ) bool {
170
+ return strings .Contains (tag [FIELD_SIGNATURE ], "=" )
171
+ }
172
+
163
173
func filterOutTagsWithField (tags []map [string ]string , field string ) []map [string ]string {
164
174
var newTags []map [string ]string
165
175
for _ , tag := range tags {
0 commit comments