diff --git a/ChangeLog b/ChangeLog index a732dd7cd..9954aa01f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-12-18 Richard Frith-Macdonald + + * Tools/AGSHtml.m: Fix 'standards' output. + * Tools/AGSOutput.m: Add 'standards' support for class, category, + and protocol. Use new standards info from parser. + * Tools/AGSParser.h: New method to set current standards. + * Tools/AGSParser.m: Implement simplistic parsing of preprocessor + conditionals to set current standards based on STRICT_MACOS_X, + STRICT_OPENSTEP, and NO_GNUSTEP. The presence of + markup in the comments still takes precedence over this mechanism. + 2001-12-18 Richard Frith-Macdonald * Source/GSXML.m: Bugfixes in setting parse behavior ... now turns diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 9c47ca709..e26ad4442 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -975,7 +975,7 @@ NSLog(@"Element '%@' not implemented", name); // FIXME children = [node next]; if ([[children name] isEqual: @"standards"]) { - tmp = [node children]; + tmp = [children children]; if (tmp != nil) { [buf appendString: indent]; @@ -1515,7 +1515,7 @@ NSLog(@"Element '%@' not implemented", name); // FIXME } if (node != nil && [[node name] isEqual: @"standards"] == YES) { - GSXMLNode *tmp = node; + GSXMLNode *tmp = [node children]; if (tmp != nil) { diff --git a/Tools/AGSOutput.m b/Tools/AGSOutput.m index 468637d97..b1447dbeb 100644 --- a/Tools/AGSOutput.m +++ b/Tools/AGSOutput.m @@ -538,6 +538,10 @@ static BOOL snuggleStart(NSString *t) AUTORELEASE(m); } } + if (standards == nil) + { + standards = [d objectForKey: @"Standards"]; + } [str appendString: @" "]; + if (comment != nil && r.length > 0) + { + unsigned i = r.location; + + r = NSMakeRange(i, [comment length] - i); + r = [comment rangeOfString: @"" + options: NSLiteralSearch + range: r]; + if (r.length > 0) + { + NSMutableString *m; + + r = NSMakeRange(i, NSMaxRange(r) - i); + standards = [comment substringWithRange: r]; + m = [comment mutableCopy]; + [m deleteCharactersInRange: r]; + comment = m; + AUTORELEASE(m); + } + else + { + NSLog(@"unterminated in comment for %@", name); + } + } + if (standards == nil) + { + standards = [d objectForKey: @"Standards"]; + } + /* * Make sure we have a 'unit' part and a class 'desc' part (comment) * to be output. @@ -744,6 +779,10 @@ static BOOL snuggleStart(NSString *t) [self outputMethod: [methods objectForKey: mName] to: str]; } + if (standards != nil) + { + [self reformat: standards withIndent: ind to: str]; + } ind -= 2; for (j = 0; j < ind; j++) [str appendString: @" "]; [str appendString: @" 0) + { + NSMutableString *s = nil; + BOOL found = NO; + + s = [NSMutableString stringWithCString: ""]; + while (c-- > 0) + { + NSString *name = [ifStack objectAtIndex: c]; + + /* + * We don't produce output for empty strings or + * the 'NotGNUstep' string. + */ + if ([name isEqualToString: @""] == NO + && [name isEqualToString: @"NotGNUstep"] == NO) + { + found = YES; + [s appendFormat: @"<%@ />", name]; + } + } + if (found == YES) + { + [s appendString: @""]; + [dict setObject: s forKey: @"Standards"]; + } + } +} @end