Permalink
Browse files

More minor renaming

  • Loading branch information...
1 parent 883e023 commit b7248cf772e8e23edf2c5c99969fec539537b962 @ccgus committed Oct 24, 2013
Showing with 20 additions and 16 deletions.
  1. +1 −1 res/English.lproj/JSTDocument.xib
  2. +11 −5 src/JSTalk.h
  3. +8 −10 src/JSTalk.m
@@ -55,7 +55,7 @@
<fragment>
<string key="content">var message = "Hello World!";
-[[JSTalk application:"Cocoa Script Editor"] displayDialog:message];</string>
+[[COScript application:"Cocoa Script Editor"] displayDialog:message];</string>
<attributes>
<font key="NSFont" size="13" name="Menlo-Regular"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural"/>
View
@@ -10,10 +10,9 @@
#import <JavaScriptCore/JavaScriptCore.h>
@class Mocha;
-@interface JSTalk : NSObject {
+@class JSTalk;
+@interface COScript : NSObject {
- NSMutableDictionary *_env;
- BOOL _shouldPreprocess;
Mocha *_mochaRuntime;
}
@@ -43,6 +42,13 @@
@end
-@interface NSObject (JSTalkErrorControllerMethods)
-- (void)JSTalk:(JSTalk*)jstalk hadError:(NSString*)error onLineNumber:(NSInteger)lineNumber atSourceURL:(id)url;
+@interface NSObject (COScriptErrorControllerMethods)
+- (void)coscript:(COScript*)coscript hadError:(NSString*)error onLineNumber:(NSInteger)lineNumber atSourceURL:(id)url;
@end
+
+
+@interface JSTalk : COScript {
+
+}
+
+@end
View
@@ -33,11 +33,7 @@ - (void) print:(NSString*)s;
@end
-@implementation JSTalk
-@synthesize printController=_printController;
-@synthesize errorController=_errorController;
-@synthesize env=_env;
-@synthesize shouldPreprocess=_shouldPreprocess;
+@implementation COScript
+ (void)listen {
[JSTListener listen];
@@ -56,8 +52,8 @@ - (id)init {
if ((self != nil)) {
_mochaRuntime = [[Mocha alloc] init];
- self.env = [NSMutableDictionary dictionary];
- _shouldPreprocess = YES;
+ [self setEnv:[NSMutableDictionary dictionary]];
+ [self setShouldPreprocess:YES];
[self addExtrasToRuntime];
}
@@ -249,7 +245,7 @@ - (id)executeString:(NSString*)str {
[JSTalk loadPlugins];
}
- if (_shouldPreprocess) {
+ if ([self shouldPreprocess]) {
str = [JSTPreprocessor preprocessCode:str];
}
@@ -269,8 +265,8 @@ - (id)executeString:(NSString*)str {
NSDictionary *d = [e userInfo];
if ([d objectForKey:@"line"]) {
- if ([_errorController respondsToSelector:@selector(JSTalk:hadError:onLineNumber:atSourceURL:)]) {
- [_errorController JSTalk:self hadError:[e reason] onLineNumber:[[d objectForKey:@"line"] integerValue] atSourceURL:nil];
+ if ([_errorController respondsToSelector:@selector(coscript:hadError:onLineNumber:atSourceURL:)]) {
+ [_errorController coscript:self hadError:[e reason] onLineNumber:[[d objectForKey:@"line"] integerValue] atSourceURL:nil];
}
}
@@ -477,5 +473,7 @@ + (id)proxyForApp:(NSString*)app {
@end
+@implementation JSTalk
+@end

0 comments on commit b7248cf

Please sign in to comment.