mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 03:51:22 +00:00
More improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20390 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b282d75ec3
commit
2363466584
3 changed files with 43 additions and 12 deletions
|
@ -32,6 +32,7 @@
|
||||||
#include <InterfaceBuilder/IBPalette.h>
|
#include <InterfaceBuilder/IBPalette.h>
|
||||||
#include <GNUstepBase/GSCategories.h>
|
#include <GNUstepBase/GSCategories.h>
|
||||||
#include <Foundation/NSValue.h>
|
#include <Foundation/NSValue.h>
|
||||||
|
#include <Foundation/NSException.h>
|
||||||
|
|
||||||
#include <GormObjCHeaderParser/OCHeaderParser.h>
|
#include <GormObjCHeaderParser/OCHeaderParser.h>
|
||||||
#include <GormObjCHeaderParser/OCClass.h>
|
#include <GormObjCHeaderParser/OCClass.h>
|
||||||
|
@ -1594,6 +1595,10 @@
|
||||||
NSMutableArray *actions = [NSMutableArray array];
|
NSMutableArray *actions = [NSMutableArray array];
|
||||||
NSMutableArray *outlets = [NSMutableArray array];
|
NSMutableArray *outlets = [NSMutableArray array];
|
||||||
|
|
||||||
|
// skip it, if it's category... for now. TODO: make categories work...
|
||||||
|
if([cls isCategory])
|
||||||
|
continue;
|
||||||
|
|
||||||
while((method = (OCMethod *)[men nextObject]) != nil)
|
while((method = (OCMethod *)[men nextObject]) != nil)
|
||||||
{
|
{
|
||||||
if([method isAction])
|
if([method isAction])
|
||||||
|
@ -1610,10 +1615,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[self addClassNamed: className
|
if([self isKnownClass: superClass])
|
||||||
withSuperClassNamed: superClass
|
{
|
||||||
withActions: actions
|
[self addClassNamed: className
|
||||||
withOutlets: outlets];
|
withSuperClassNamed: superClass
|
||||||
|
withActions: actions
|
||||||
|
withOutlets: outlets];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = NO;
|
||||||
|
[NSException raise: @"UnknownParentClass"
|
||||||
|
format: @"The superclass %@ of class %@ is not known, please parse it.",
|
||||||
|
superClass, className];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "GormFilePrefsManager.h"
|
#include "GormFilePrefsManager.h"
|
||||||
#include "GormViewWindow.h"
|
#include "GormViewWindow.h"
|
||||||
#include <Foundation/NSUserDefaults.h>
|
#include <Foundation/NSUserDefaults.h>
|
||||||
|
#include <Foundation/NSException.h>
|
||||||
#include <AppKit/NSImage.h>
|
#include <AppKit/NSImage.h>
|
||||||
#include <AppKit/NSSound.h>
|
#include <AppKit/NSSound.h>
|
||||||
#include <AppKit/NSNibConnector.h>
|
#include <AppKit/NSNibConnector.h>
|
||||||
|
@ -1259,18 +1260,30 @@ static NSImage *fileImage = nil;
|
||||||
if (result == NSOKButton)
|
if (result == NSOKButton)
|
||||||
{
|
{
|
||||||
NSString *fileName = [oPanel filename];
|
NSString *fileName = [oPanel filename];
|
||||||
if(![classManager parseHeader: fileName])
|
|
||||||
|
NS_DURING
|
||||||
{
|
{
|
||||||
NSString *message = [NSString stringWithFormat:
|
if(![classManager parseHeader: fileName])
|
||||||
_(@"An error occurred while parsing %@"),fileName];
|
{
|
||||||
|
NSString *message = [NSString stringWithFormat:
|
||||||
|
_(@"An error occurred while parsing %@"),fileName];
|
||||||
|
NSRunAlertPanel(_(@"Problem parsing class"),
|
||||||
|
message,
|
||||||
|
nil, nil, nil);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
NSString *message = [localException reason];
|
||||||
NSRunAlertPanel(_(@"Problem parsing class"),
|
NSRunAlertPanel(_(@"Problem parsing class"),
|
||||||
message,
|
message,
|
||||||
nil, nil, nil);
|
nil, nil, nil);
|
||||||
}
|
}
|
||||||
else
|
NS_ENDHANDLER
|
||||||
{
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -68,16 +68,18 @@
|
||||||
NSString *finalString = [NSString stringWithString: @""];
|
NSString *finalString = [NSString stringWithString: @""];
|
||||||
|
|
||||||
// strip all of the one line comments out...
|
// strip all of the one line comments out...
|
||||||
|
[scanner setCharactersToBeSkipped: nil];
|
||||||
while(![scanner isAtEnd])
|
while(![scanner isAtEnd])
|
||||||
{
|
{
|
||||||
NSString *tempString = nil;
|
NSString *tempString = nil;
|
||||||
[scanner scanUpToString: @"//" intoString: &tempString];
|
[scanner scanUpToString: @"//" intoString: &tempString];
|
||||||
[scanner scanUpToAndIncludingString: @"\n" intoString: NULL];
|
[scanner scanUpToString: @"\n" intoString: NULL];
|
||||||
resultString = [resultString stringByAppendingString: tempString];
|
resultString = [resultString stringByAppendingString: tempString];
|
||||||
}
|
}
|
||||||
|
|
||||||
// strip all of the multiline comments out...
|
// strip all of the multiline comments out...
|
||||||
scanner = [NSScanner scannerWithString: resultString];
|
scanner = [NSScanner scannerWithString: resultString];
|
||||||
|
[scanner setCharactersToBeSkipped: nil];
|
||||||
while(![scanner isAtEnd])
|
while(![scanner isAtEnd])
|
||||||
{
|
{
|
||||||
NSString *tempString = nil;
|
NSString *tempString = nil;
|
||||||
|
@ -96,6 +98,7 @@
|
||||||
NSString *resultString = [NSString stringWithString: @""];
|
NSString *resultString = [NSString stringWithString: @""];
|
||||||
|
|
||||||
// strip all of the one line comments out...
|
// strip all of the one line comments out...
|
||||||
|
[scanner setCharactersToBeSkipped: nil];
|
||||||
while(![scanner isAtEnd])
|
while(![scanner isAtEnd])
|
||||||
{
|
{
|
||||||
NSString *tempString = nil;
|
NSString *tempString = nil;
|
||||||
|
|
Loading…
Reference in a new issue