Corrected problem with header parser.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20703 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-02-14 05:54:39 +00:00
parent 5454bafb52
commit f016e032d8
2 changed files with 28 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2005-02-14 01:00 Gregory John Casamento <greg_casamento@yahoo.com>
* GormObjCHeaderParser/OCIVarDecl.m: Corrected problem with
reading declarations which have the "*" spaced oddly. Problem
reported by Nicolas Roard.
2005-02-13 09:37 Gregory John Casamento <greg_casamento@yahoo.com>
* GModelDecoder.m: After gmodel load, mark the document as

View file

@ -63,6 +63,7 @@
NSScanner *stripScanner = [NSScanner scannerWithString: ivarString];
NSString *resultString = nil;
NSString *tempString = [NSString stringWithString: @""];
NSString *tempString2 = [NSString stringWithString: @""];
NSCharacterSet *wsnl = [NSCharacterSet whitespaceAndNewlineCharacterSet];
NSString *typeName = [NSString stringWithString: @""];
NSString *varName = [NSString stringWithString: @""];
@ -78,10 +79,28 @@
}
}
// strip protocol qualifiers
if(lookAhead(tempString,@"<"))
if(lookAhead(tempString, @"*"))
{
stripScanner = [NSScanner scannerWithString: tempString];
while(![stripScanner isAtEnd])
{
NSString *string = nil, *string2 = nil;
[stripScanner scanUpToString: @"*" intoString: &string];
[stripScanner scanString: @"*" intoString: NULL];
[stripScanner scanUpToCharactersFromSet: wsnl intoString: &string2];
tempString2 = [tempString2 stringByAppendingString: string];
tempString2 = [tempString2 stringByAppendingString: string2];
}
}
else
{
tempString2 = tempString;
}
// strip protocol qualifiers
if(lookAhead(tempString2,@"<"))
{
stripScanner = [NSScanner scannerWithString: tempString2];
[stripScanner scanUpToString: @"<" intoString: &typeName];
[stripScanner scanUpToAndIncludingString: @">" intoString: NULL];
[stripScanner scanUpToCharactersFromSet: wsnl intoString: &varName];
@ -91,7 +110,7 @@
}
else
{
resultString = tempString;
resultString = tempString2;
}
ASSIGN(ivarString, resultString);