mirror of
https://github.com/gnustep/libs-steptalk.git
synced 2025-02-15 16:10:52 +00:00
Compiler warnings cleanup, Shell fixed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@18145 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5ce611c23e
commit
ecd3a33b3f
13 changed files with 136 additions and 39 deletions
|
@ -1,3 +1,8 @@
|
|||
2003 Nov 24 Stefan Urbanek <stefanu@altair.dcs.elf.stuba.sk>
|
||||
|
||||
* Few fixes, removed some compiler warnings. Fixed Shell to use
|
||||
proper environment.
|
||||
|
||||
2003 Nov 8 Stefan Urbanek <stefanu@altair.dcs.elf.stuba.sk>
|
||||
|
||||
* Updated tools to use STConversation object.
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
@interface STShell:NSObject
|
||||
{
|
||||
STScriptsManager *scriptsManager;
|
||||
STEnvironment *env;
|
||||
STConversation *conversation;
|
||||
|
||||
NSString *prompt;
|
||||
|
|
|
@ -142,16 +142,17 @@ int complete_handler(void)
|
|||
|
||||
- (void)setEnvironment:(STEnvironment *)newEnv
|
||||
{
|
||||
ASSIGN(env, newEnv);
|
||||
[conversation setEnvironment:newEnv];
|
||||
}
|
||||
|
||||
- (STEnvironment *)environment
|
||||
{
|
||||
return env;
|
||||
return [conversation environment];
|
||||
}
|
||||
|
||||
- (void)run
|
||||
{
|
||||
STEnvironment *env = [conversation environment];
|
||||
NSString *line;
|
||||
id result;
|
||||
|
||||
|
@ -169,6 +170,8 @@ int complete_handler(void)
|
|||
|
||||
[self showLine:@"Welcome to the StepTalk shell."];
|
||||
|
||||
NSLog(@"Environment %@", env);
|
||||
|
||||
while(1)
|
||||
{
|
||||
line = [self readLine];
|
||||
|
@ -199,6 +202,7 @@ int complete_handler(void)
|
|||
}
|
||||
- (id)executeLine:(NSString *)line
|
||||
{
|
||||
STEnvironment *env = [conversation environment];
|
||||
NSString *cmd;
|
||||
id result = nil;
|
||||
|
||||
|
@ -257,6 +261,7 @@ int complete_handler(void)
|
|||
|
||||
- (int)completion
|
||||
{
|
||||
STEnvironment *env = [conversation environment];
|
||||
NSEnumerator *enumerator;
|
||||
NSMutableSet *set;
|
||||
NSString *match;
|
||||
|
|
|
@ -32,6 +32,7 @@ id STObjectFromValueOfType(void *value, const char *type);
|
|||
|
||||
@interface NSInvocation(STAdditions)
|
||||
+ invocationWithTarget:(id)target selectorName:(NSString *)selectorName;
|
||||
+ invocationWithTarget:(id)target selector:(SEL)selector;
|
||||
|
||||
- (void)setArgumentAsObject:(id)anObject atIndex:(int)anIndex;
|
||||
- (id)getArgumentAsObjectAtIndex:(int)anIndex;
|
||||
|
|
|
@ -257,6 +257,31 @@ void STGetValueOfTypeFromObject(void *value, const char *type, id anObject)
|
|||
return invocation;
|
||||
}
|
||||
|
||||
+ invocationWithTarget:(id)target selector:(SEL)selector
|
||||
{
|
||||
NSMethodSignature *signature;
|
||||
NSInvocation *invocation;
|
||||
|
||||
signature = [target methodSignatureForSelector:selector];
|
||||
|
||||
|
||||
if(!signature)
|
||||
{
|
||||
[NSException raise:STInternalInconsistencyException
|
||||
format:@"No method signature for selector '%@' for "
|
||||
@"receiver of type %@",
|
||||
NSStringFromSelector(selector),[target className]];
|
||||
return nil;
|
||||
}
|
||||
|
||||
invocation = [NSInvocation invocationWithMethodSignature:signature];
|
||||
|
||||
[invocation setSelector:selector];
|
||||
[invocation setTarget:target];
|
||||
|
||||
return invocation;
|
||||
}
|
||||
|
||||
- (void)setArgumentAsObject:(id)anObject atIndex:(int)anIndex
|
||||
{
|
||||
const char *type;
|
||||
|
|
|
@ -37,7 +37,11 @@
|
|||
NSString *languageName;
|
||||
STEnvironment *environment;
|
||||
}
|
||||
+ conversationInEnvironment:(STEnvironment *)env
|
||||
/*
|
||||
+ conversationWithApplication:(NSString *)appName
|
||||
language:(NSString *)langName;
|
||||
*/
|
||||
+ conversationWithEnvironment:(STEnvironment *)env
|
||||
language:(NSString *)langName;
|
||||
|
||||
- initWithEnvironment:(STEnvironment *)env
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
}
|
||||
/** Creates a new conversation with environment created using default
|
||||
description and language with name <var>langName</var>. */
|
||||
+ conversationInEnvironment:(STEnvironment *)env
|
||||
+ conversationWithEnvironment:(STEnvironment *)env
|
||||
language:(NSString *)langName
|
||||
{
|
||||
STConversation *c;
|
||||
|
@ -114,6 +114,7 @@
|
|||
{
|
||||
[self _createEngine];
|
||||
}
|
||||
NSLog(@"Run script in %@", environment);
|
||||
return [engine executeCode: aString inEnvironment:environment];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -40,5 +40,5 @@
|
|||
- (NSString *)scriptName;
|
||||
- (NSString *)localizedName;
|
||||
- (NSString *)scriptDescription;
|
||||
- (NSComparisonResult)compareByLocalizedName:(STScript *)aScript;
|
||||
- (NSComparisonResult)compareByLocalizedName:(STFileScript *)aScript;
|
||||
@end
|
||||
|
|
|
@ -28,11 +28,13 @@
|
|||
|
||||
@interface STSelector:NSObject
|
||||
{
|
||||
NSString *selectorName;
|
||||
SEL sel;
|
||||
}
|
||||
- initWithName:(NSString *)aString;
|
||||
- initWithSelector:(SEL)aSel;
|
||||
|
||||
- (SEL)selectorValue;
|
||||
- (NSString *)stringValue;
|
||||
- (NSString *)selectorName;
|
||||
@end
|
||||
|
||||
|
|
|
@ -25,27 +25,70 @@
|
|||
*/
|
||||
|
||||
#import "STSelector.h"
|
||||
#import "STObjCRuntime.h"
|
||||
|
||||
#import <Foundation/NSCoder.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
@implementation STSelector
|
||||
- initWithName:(NSString *)aString
|
||||
{
|
||||
[super init];
|
||||
|
||||
selectorName = RETAIN(aString);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- initWithSelector:(SEL)aSel
|
||||
{
|
||||
[super init];
|
||||
sel = aSel;
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc
|
||||
{
|
||||
RELEASE(selectorName);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (SEL)selectorValue
|
||||
{
|
||||
if(sel == 0)
|
||||
{
|
||||
sel = STSelectorFromString(selectorName);
|
||||
}
|
||||
return sel;
|
||||
}
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return NSStringFromSelector(sel);
|
||||
return [NSString stringWithFormat:@"#%@", [self selectorName]];
|
||||
}
|
||||
|
||||
- (NSString *)stringValue
|
||||
- (NSString *)selectorName
|
||||
{
|
||||
return NSStringFromSelector(sel);
|
||||
if(!selectorName)
|
||||
{
|
||||
selectorName = RETAIN(NSStringFromSelector(sel));
|
||||
}
|
||||
|
||||
return selectorName;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)coder
|
||||
{
|
||||
// [super encodeWithCoder: coder];
|
||||
|
||||
[coder encodeObject:selectorName];
|
||||
}
|
||||
|
||||
- initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
self = [super init]; // super initWithCoder: decoder];
|
||||
|
||||
[decoder decodeValueOfObjCType: @encode(id) at: &selectorName];
|
||||
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
|
43
TODO
43
TODO
|
@ -1,20 +1,33 @@
|
|||
TODO list
|
||||
|
||||
1 handle 'connection did die' notification for distant objects in STEnvironment
|
||||
2 fix class-info lookup for proxies in STEnvironment
|
||||
3 implement NSRect object
|
||||
5 Smalltalk: separate compiler and compilation context
|
||||
9 create a 'Shell' scripting environment
|
||||
11 Create ApplicationScripting framework, instead of bundle. It should offer
|
||||
HIGH PRIORITY
|
||||
|
||||
- implement NSRect object
|
||||
- Rewrite Smalltalk compiler (grammar)
|
||||
|
||||
Remove STBytecodeInterpreter and use only STCompiler. How?
|
||||
Simply convert language constructions into 'command' objects like
|
||||
SmalltalkStatement, SmalltalkPrimary, SmalltalkMethodSend, ...
|
||||
and implement executeInEnvironment:context:receiver:
|
||||
|
||||
- Update application scripting to use STConversation
|
||||
|
||||
LOW PRIORITY
|
||||
|
||||
UNDEFINED
|
||||
|
||||
- handle 'connection did die' notification for distant objects in STEnvironment
|
||||
- fix class-info lookup for proxies in STEnvironment
|
||||
- Smalltalk: separate compiler and compilation context
|
||||
- create a 'Shell' scripting environment
|
||||
- Create ApplicationScripting framework, instead of bundle. It should offer
|
||||
passive application scripting (without linking) and active app. scripting
|
||||
(linking with the framewotk). Give it some reasonable name, becauase that one
|
||||
is already used by Apple
|
||||
13 Change source directory structure (see DevelopmentNotes.txt in Doumentation)
|
||||
14 Add framework list into environment description
|
||||
15 Change Modules to Framework
|
||||
16 Remove StepTalk modules
|
||||
17 Fill implementation of STScriptObject, STMethod and related STEngine methods
|
||||
18 Rewrite Smalltalk compiler (grammar)
|
||||
19 Remove empty directories (Source, Modules/StepTalk)
|
||||
20 Replace STMethod languageName with map table of method class->engine class
|
||||
21 Update application scripting to use STConversation
|
||||
- Add framework list into environment description
|
||||
- Change Modules to Frameworks
|
||||
- Fill implementation of STScriptObject, STMethod and related STEngine methods
|
||||
- Remove empty directories (Source, Modules/StepTalk)
|
||||
- Replace STMethod languageName with map table of method class->engine class
|
||||
|
||||
|
||||
|
|
|
@ -97,7 +97,6 @@
|
|||
after moving from STEngnie to STConversation */
|
||||
- (void)createConversation
|
||||
{
|
||||
STEnvironmentDescription *desc;
|
||||
STEnvironment *env;
|
||||
|
||||
if([target respondsToSelector:@selector(scriptingEnvironment)])
|
||||
|
|
2
Version
2
Version
|
@ -4,7 +4,7 @@
|
|||
# The version number of this release.
|
||||
MAJOR_VERSION=0
|
||||
MINOR_VERSION=8
|
||||
SUBMINOR_VERSION=1
|
||||
SUBMINOR_VERSION=2
|
||||
|
||||
STEPTALK_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION}
|
||||
|
||||
|
|
Loading…
Reference in a new issue