mirror of
https://github.com/gnustep/libs-steptalk.git
synced 2025-02-19 09:50:43 +00:00
Added few named objects
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@17694 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
198a6c55e9
commit
f8d5260c54
2 changed files with 15 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
2003 Sep 21
|
||||
|
||||
* Added named objects FileManager, LastCommand and LastObject
|
||||
|
||||
2003 Jun 19
|
||||
|
||||
* Renamed stshell.m to stshell_tool.m. MS Windows was causing problems with
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSNotification.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSFileManager.h>
|
||||
#import <Foundation/NSSet.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
@ -155,10 +156,13 @@ int complete_handler(void)
|
|||
|
||||
[env setCreatesUnknownObjects:YES];
|
||||
|
||||
/* Add standard objects */
|
||||
[env setObject:self forName:@"Shell"];
|
||||
[env setObject:self forName:@"Transcript"];
|
||||
[env setObject:objectStack forName:@"Objects"];
|
||||
|
||||
[env setObject:[NSFileManager defaultManager] forName:@"FileManager"];
|
||||
|
||||
/* FIXME: This is unsafe !*/
|
||||
[env setObject:env forName:@"Environment"];
|
||||
|
||||
|
@ -194,16 +198,21 @@ int complete_handler(void)
|
|||
}
|
||||
- (id)executeLine:(NSString *)line
|
||||
{
|
||||
NSString *cmd;
|
||||
id result = nil;
|
||||
|
||||
/* FIXME: why? */
|
||||
line = [line stringByAppendingString:@" "];
|
||||
|
||||
cmd = [line stringByAppendingString:@" "];
|
||||
NS_DURING
|
||||
result = [engine executeCode:line inEnvironment:env];
|
||||
result = [engine executeCode:cmd inEnvironment:env];
|
||||
NS_HANDLER
|
||||
[self showException:localException];
|
||||
NS_ENDHANDLER
|
||||
|
||||
[env setObject:line forName:@"LastCommand"];
|
||||
[env setObject:result forName:@"LastObject"];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue