Add warnings about private methods and variables.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14754 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-10-13 07:51:56 +00:00
parent ec9ec912da
commit 0a68c0e5ee
3 changed files with 27 additions and 1 deletions

View file

@ -4,6 +4,7 @@
type specifications of the form (id<protocol1,protocol2,...>)
* Tools/autogsdoc.m: Add -Files option to read names of files
to process as a property list rather than using command line args.
* Tools/AGSParser.m: Warn about private methods and ivars.
2002-10-12 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -113,6 +113,7 @@
- (unsigned) skipToEndOfLine;
- (unsigned) skipUnit;
- (NSMutableArray*) sources;
- (id) _foo;
@end
/** Let's document a macro

View file

@ -2000,6 +2000,22 @@ try:
if (iv != nil)
{
if ([visibility isEqual: @"private"] == NO)
{
NSString *n = [iv objectForKey: @"Name"];
if ([n hasPrefix: @"_"] == YES)
{
NSString *c;
c = @"<em>Warning</em> the underscore at the start of "
@"the name of this instance variable indicates that, "
@"even though it is not technically <em>private</em>, "
@"it is intended for internal use within the package, "
@"and you should not use the variable in other code.";
[self appendComment: c to: iv];
}
}
[iv setObject: visibility forKey: @"Visibility"];
[ivars setObject: iv forKey: [iv objectForKey: @"Name"]];
}
@ -2364,9 +2380,17 @@ fail:
[self appendComment: comment to: method];
DESTROY(comment);
}
if ([itemName length] > 1 && [itemName characterAtIndex: 1] == '_')
{
NSString *c;
c = @"<em>Warning</em> the underscore at the start of the name "
@"of this method indicates that it is private, for internal use only, "
@" and you should not use the method in your code.";
[self appendComment: c to: method];
}
itemName = nil;
DESTROY(comment);
RELEASE(arp);
AUTORELEASE(method);
return method;