Improve method reference stuff

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11781 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-12-17 07:11:23 +00:00
parent 2edc64bbc9
commit ca53f346fc
4 changed files with 49 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2001-12-17 Richard Frith-Macdonald <rfm@gnu.org>
* Tools/AGSOutput.m: Support (name) syntax for specifying a protocol
cross reference using [(name)-method]
* Tools/autogsdoc.m: Improve documentation of method references.
2001-12-16 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSObject.m: Make initial comment an autogsdoc comment.

View file

@ -1,4 +1,4 @@
/* Interface for NSObject for GNUStep
/**Interface for NSObject for GNUStep
Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>

View file

@ -1188,6 +1188,9 @@ static BOOL snuggleStart(NSString *t)
&& [identStart characterIsMember:
(c = [tmp characterAtIndex: pos])] == YES)
{
/*
* Look for class or category name.
*/
pos++;
while (pos < ePos)
{
@ -1236,6 +1239,30 @@ static BOOL snuggleStart(NSString *t)
cName = [tmp substringWithRange: r];
}
}
else if (pos < ePos
&& (c = [tmp characterAtIndex: pos]) == '(')
{
/*
* Look for protocol name.
*/
pos++;
while (pos < ePos)
{
c = [tmp characterAtIndex: pos];
if (c == ')')
{
pos++;
r = NSMakeRange(sPos, pos - sPos);
cName = [tmp substringWithRange: r];
if (pos < ePos)
{
c = [tmp characterAtIndex: pos];
}
break;
}
pos++;
}
}
if (pos < ePos && (c == '+' || c == '-'))
{

View file

@ -154,11 +154,24 @@
</item>
<item>Method names (beginning with a plus or minus) are enclosed
in &lt;ref...&gt; ... &lt;/ref&gt; markup.<br />
eg. -init
eg. "-init" (without the quotes) would be wrapped in a gsdoc
reference element to point to the init method of the current
class or, if only one known class had an init method, it
would refer to the method of that class.
<br />Note the fact that the method name must be surrounded by
whitespace (though a comma, fullstop, or semicolon at the end
of the specifier will also act as a whitespace terminator).
</item>
<item>Method specifiers including class names (beginning and ending with
square brackets) are enclosed in &lt;ref...&gt; ... &lt;/ref&gt; markup.
<br />eg. [NSObject -init]
<br />eg. [ NSObject-init],
will create a reference to the init method of NSObject, while
<br />[ (NSCopying)-copyWithZone:], creates a
reference to a method in the NSCopyIng protocol, and
<br />[ NSObject(TimedPerformers)-performSelector:withObject:afterDelay:],
creates a reference to a method in the TimedPerformers category.
<br />Note that no spaces must appear between the square brackets
in these specifiers.
</item>
</list>
<p>