sourcepawn icon indicating copy to clipboard operation
sourcepawn copied to clipboard

docparse: directive support

Open rumblefrog opened this issue 6 years ago • 1 comments

Directive Parsing Support

For a long time now, it's almost a norm to perceive that if a declaration has empty web documentation, it is, therefore, deprecated, making this bug an actual feature.

But I wish to correct this "feature" for reasons for posterity of old documentation and prevent confusion for newcomers as a clear red indicator of deprecation and an alternative function message would provide much more details than empty documentation.

As of right now, the docparse searches for doc termination exactly one line above it, and if it's not found, the entire block is voided and the docStart and docEnd is zeroed: https://github.com/alliedmodders/sourcepawn/blob/7e69f7eaf58a05e89912487af646b7121e19d1a4/exp/tools/docparse/docparse.cpp#L112-L117

My proposal is to include or fix the parsing of preprocessor directive such as:

#pragma deprecated

So blocks like these can be properly and fully parsed:

/**
 * Backwards compatible stock - StrCompare is now strcmp
 * @deprecated          Renamed to strcmp
 */
#pragma deprecated Use strcmp() instead
stock int StrCompare(const char[] str1, const char[] str2, bool caseSensitive=true)
{
	return strcmp(str1, str2, caseSensitive);
}

rumblefrog avatar Nov 05 '19 15:11 rumblefrog

how might the parsed result appear on the new-api page?

JoinedSenses avatar Nov 07 '19 04:11 JoinedSenses