Browse code

Various improvements and some MulleFoundation specific stuff, to be merged with master.

Nat! authored on 16-05-2016 15:23:51
Showing 28 changed files
... ...
@@ -1,2 +1,2 @@
1
-http://google-toolbox-for-mac.googlecode.com/svn/trunk/;google-toolbox-for-mac
2
-
1
+https://github.com/mulle-nat/google-toolbox-for-mac
2
+https://www.mulle-kybernetik.com/repositories/mulle-configuration;;MulleScion
3 3
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-svn
... ...
@@ -17,3 +17,4 @@ tests/compare-parse-speed-to-unarchive-speed.sh
17 17
 .bootstrap.local/
18 18
 dependencies/
19 19
 .repos/
20
+mulle-configuration/
... ...
@@ -33,21 +33,30 @@
33 33
 //  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 34
 //  POSSIBILITY OF SUCH DAMAGE.
35 35
 //
36
-#ifdef __LP64__
36
+#ifdef __MULLE_OBJC_RUNTIME__
37 37
 
38
-#import <objc/runtime.h>
38
+static inline Class   MulleGetClass( id self)
39
+{
40
+   return( mulle_objc_object_get_isa( self));
41
+}
42
+
43
+#else
44
+# ifdef __LP64__
45
+
46
+# import <objc/runtime.h>
39 47
 
40 48
 static inline Class   MulleGetClass( id self)
41 49
 {
42 50
    return( object_getClass( self));
43 51
 }
44 52
 
45
-#else
53
+# else
46 54
 
47
-#import <objc/objc.h>
55
+# import <objc/objc.h>
48 56
 
49 57
 static inline Class   MulleGetClass( id self)
50 58
 {
51 59
    return( ((struct objc_object *) self)->isa);
52 60
 }
61
+# endif
53 62
 #endif
... ...
@@ -76,7 +76,7 @@ static NSURL   *_mulle_scion_url_from_request_info( struct mg_request_info   *in
76 76
    NSURL      *url;
77 77
    NSString   *s;
78 78
    
79
-   s    = [NSString stringWithCString:info->uri];
79
+   s    = [NSString stringWithCString:(char *) info->uri];
80 80
    if( [s hasPrefix:@"/"])
81 81
       s = [s substringFromIndex:1];
82 82
    s    = [s urlEscapedString];
... ...
@@ -106,7 +106,7 @@ static int   _mulle_mongoose_begin_request( struct mg_connection *conn)
106 106
       return( 0);
107 107
 
108 108
    plist    = info->user_data;
109
-   query    = [NSString stringWithCString:info->query_string ? info->query_string : ""];
109
+   query    = [NSString stringWithCString:(char *) (info->query_string ? info->query_string : "")];
110 110
    template = [[[MulleScionTemplate alloc] initWithContentsOfFile:[url path]
111 111
                                                     optionsString:query] autorelease];
112 112
    if( template)
... ...
@@ -124,6 +124,7 @@
124 124
 + (NSString *) cacheDirectory;
125 125
 + (void) setCacheEnabled:(BOOL) flag;
126 126
 + (BOOL) isCacheEnabled;
127
+- (NSString *) cachePathForPath:(NSString *) fileName;
127 128
 
128 129
 @end
129 130
 
... ...
@@ -36,7 +36,10 @@
36 36
 
37 37
 
38 38
 #import "MulleScion.h"
39
+
39 40
 #import "MulleScionTemplate+CompressedArchive.h"
41
+#import "MulleCommonObjCRuntime.h"
42
+
40 43
 
41 44
 #ifndef PROJECT_VERSION
42 45
 # error "specify project version on command line -DPROJECT_VERSION=1848.x"
... ...
@@ -178,8 +181,8 @@ static id   acquirePropertyList( NSObject <MulleScionStringOrURL> *s)
178 181
    MulleScionParser   *parser;
179 182
 
180 183
    parser = [MulleScionParser parserWithUTF8String:s];
181
-   [self autorelease];
182
-   
184
+
185
+   [self release];
183 186
    self = [[parser template] retain];
184 187
    return( self);
185 188
 }
... ...
@@ -205,7 +208,7 @@ static id   acquirePropertyList( NSObject <MulleScionStringOrURL> *s)
205 208
    else
206 209
 #endif
207 210
    {
208
-      [self autorelease];
211
+      [self release];
209 212
       // self = nil;
210 213
    }
211 214
    
... ...
@@ -246,7 +249,7 @@ static id   acquirePropertyList( NSObject <MulleScionStringOrURL> *s)
246 249
    else
247 250
 #endif
248 251
    {
249
-      [self autorelease];
252
+      [self release];
250 253
       // self = nil;
251 254
    }
252 255
    
... ...
@@ -304,7 +307,7 @@ static MulleScionPrinter  *createPrinterWithDatasource( id dataSource)
304 307
    pool = [NSAutoreleasePool new];
305 308
 
306 309
    printer = createPrinterWithDatasource( dataSource);
307
-   [printer setDefaultlocalVariables:locals];
310
+   [printer setDefaultLocalVariables:locals];
308 311
    s = [printer describeWithTemplate:self];
309 312
    
310 313
    [s retain];
... ...
@@ -322,7 +325,7 @@ static MulleScionPrinter  *createPrinterWithDatasource( id dataSource)
322 325
    
323 326
    pool = [NSAutoreleasePool new];
324 327
    printer = createPrinterWithDatasource( dataSource);
325
-   [printer setDefaultlocalVariables:locals];
328
+   [printer setDefaultLocalVariables:locals];
326 329
    [printer writeToOutput:output
327 330
                  template:self];
328 331
    [pool release];
... ...
@@ -71,14 +71,14 @@ static BOOL fileExists( NSString *fileName)
71 71
    // be sure, that users ain't spoofing us
72 72
    if( ! fileExists( fileName))
73 73
    {
74
-      [self autorelease];
74
+      [self release];
75 75
       return( nil);
76 76
    }
77 77
 
78 78
    data = [NSMutableData dataWithContentsOfMappedFile:wrapper];
79 79
    if( ! data)
80 80
    {
81
-      [self autorelease];
81
+      [self release];
82 82
       return( nil);
83 83
    }
84 84
    
... ...
@@ -105,7 +105,7 @@ static BOOL fileExists( NSString *fileName)
105 105
    // no caching :)
106 106
    parser = [[[MulleScionParser alloc] initWithData:data
107 107
                                            fileName:wrapper] autorelease];
108
-   [self autorelease];
108
+   [self release];
109 109
    self = [[parser template] retain];
110 110
    
111 111
    return( self);
... ...
@@ -175,14 +175,15 @@ static BOOL fileExists( NSString *fileName)
175 175
 {
176 176
    MulleScionParser    *parser;
177 177
    NSData              *data;
178
-   MulleScionTemplate  *template;
179 178
    
180 179
    data     = [s dataUsingEncoding:NSUTF8StringEncoding];
181 180
    parser   = [[[MulleScionParser alloc] initWithData:data
182 181
                                              fileName:@"inline"] autorelease];
183
-   template = [[parser template] retain];
184
-   [self autorelease];
185
-   return( template);
182
+
183
+   [self release];
184
+   self = [[parser template] retain];
185
+   
186
+   return( self);
186 187
 }
187 188
    
188 189
 @end
... ...
@@ -75,16 +75,17 @@
75 75
    uint32_t  lineNumber;
76 76
    id        next;
77 77
    
78
-   [decoder decodeValuesOfObjCTypes:"l", &lineNumber];
78
+   [decoder decodeValueOfObjCType:@encode( uint32_t)
79
+                               at:&lineNumber];
79 80
 
80 81
     // needed to be coded like this otherwise keyed unarchiver trashes the
81 82
     // stack
82
-   next = [[decoder decodeObject] retain];
83
+   next = [decoder decodeObject];
83 84
    
84 85
    self = [self initWithLineNumber:lineNumber];
85 86
    assert( self);
86 87
 
87
-   self->next_ = next;
88
+   self->next_ = [next retain];
88 89
    return( self);
89 90
 }
90 91
 
... ...
@@ -94,7 +95,8 @@
94 95
    uint32_t  lineNumber;
95 96
    
96 97
    lineNumber = (uint32_t) lineNumber_;
97
-   [encoder encodeValuesOfObjCTypes:"l", &lineNumber];
98
+   [encoder encodeValueOfObjCType:@encode( uint32_t)
99
+                               at:&lineNumber];
98 100
    [encoder encodeObject:next_];
99 101
 }
100 102
 
... ...
@@ -82,3 +82,9 @@ void   MulleScionRenderString( NSString *value,
82 82
                                id <MulleScionOutput> output,
83 83
                                NSMutableDictionary *locals,
84 84
                                id <MulleScionDataSource> dataSource);
85
+
86
+void   MulleScionRenderPlaintextString( NSString *value,
87
+                                        id <MulleScionOutput> output,
88
+                                        NSMutableDictionary *locals,
89
+                                        id <MulleScionDataSource> dataSource);
90
+
... ...
@@ -45,7 +45,9 @@
45 45
 #import "MulleCommonObjCRuntime.h"
46 46
 #if ! TARGET_OS_IPHONE
47 47
 # import <Foundation/NSDebug.h>
48
-# import <objc/objc-class.h>
48
+# ifndef __MULLE_OBJC_RUNTIME__
49
+#  import <objc/objc-class.h>
50
+# endif
49 51
 #else
50 52
 # import <objc/runtime.h>
51 53
 # import "NSObject+KVC_Compatibility.h"
... ...
@@ -341,9 +343,9 @@ void   MulleScionRenderString( NSString *value,
341 343
 
342 344
 
343 345
 void   MulleScionRenderPlaintextString( NSString *value,
344
-                                       id <MulleScionOutput> output,
345
-                                       NSMutableDictionary *locals,
346
-                                       id <MulleScionDataSource> dataSource)
346
+                                        id <MulleScionOutput> output,
347
+                                        NSMutableDictionary *locals,
348
+                                        id <MulleScionDataSource> dataSource)
347 349
 {
348 350
    NSString   *s;
349 351
    
... ...
@@ -739,10 +741,10 @@ static void   pop( NSAutoreleasePool *pool, id value)
739 741
 
740 742
 static void   *numberBuffer( char *type, NSNumber *value)
741 743
 {
742
-   NSUInteger          size;
743
-   NSUInteger          alignment;
744
-   void                *buf;
745
-   char                *myType;
744
+   NSUInteger   alignment;
745
+   NSUInteger   size;
746
+   char         *myType;
747
+   void         *buf;
746 748
    
747 749
    if( value && ! [value isKindOfClass:[NSValue class]])
748 750
       return( NULL);
... ...
@@ -755,18 +757,18 @@ static void   *numberBuffer( char *type, NSNumber *value)
755 757
    
756 758
    switch( *type)
757 759
    {
758
-   case _C_CHR      : *(char *) buf = [value charValue]; return( buf);
759
-   case _C_UCHR     : *(unsigned char *) buf = [value unsignedCharValue]; return( buf);
760
-   case _C_SHT      : *(short *) buf = [value shortValue]; return( buf);
760
+   case _C_CHR      : *(char *)           buf = [value charValue]; return( buf);
761
+   case _C_UCHR     : *(unsigned char *)  buf = [value unsignedCharValue]; return( buf);
762
+   case _C_SHT      : *(short *)          buf = [value shortValue]; return( buf);
761 763
    case _C_USHT     : *(unsigned short *) buf = [value unsignedShortValue]; return( buf);
762
-   case _C_INT      : *(int *) buf = [value intValue]; return( buf);
763
-   case _C_UINT     : *(unsigned int *) buf = [value unsignedIntValue]; return( buf);
764
-   case _C_LNG      : *(long *) buf = [value longValue]; return( buf);
765
-   case _C_ULNG     : *(unsigned long *) buf = [value unsignedLongValue]; return( buf);
766
-   case _C_LNG_LNG  : *(long long *) buf = [value longLongValue]; return( buf);
764
+   case _C_INT      : *(int *)            buf = [value intValue]; return( buf);
765
+   case _C_UINT     : *(unsigned int *)   buf = [value unsignedIntValue]; return( buf);
766
+   case _C_LNG      : *(long *)           buf = [value longValue]; return( buf);
767
+   case _C_ULNG     : *(unsigned long *)  buf = [value unsignedLongValue]; return( buf);
768
+   case _C_LNG_LNG  : *(long long *)      buf = [value longLongValue]; return( buf);
767 769
    case _C_ULNG_LNG : *(unsigned long long *) buf = [value unsignedLongLongValue]; return( buf);
768
-   case _C_FLT      : *(float *) buf = [value floatValue]; return( buf);
769
-   case _C_DBL      : *(double *)             buf = [value doubleValue]; return( buf);
770
+   case _C_FLT      : *(float *)          buf = [value floatValue]; return( buf);
771
+   case _C_DBL      : *(double *)         buf = [value doubleValue]; return( buf);
770 772
    }
771 773
    
772 774
    myType = (char *) [value objCType];
... ...
@@ -810,7 +812,7 @@ static void   *numberBuffer( char *type, NSNumber *value)
810 812
                                                          target:target];
811 813
    if( ! signature)
812 814
       MulleScionPrintingException( NSInvalidArgumentException, locals,
813
-                  @"Method \"%@\" is unknown on \"%@\"", NSStringFromSelector( action_), [target class]);
815
+                  @"Method \"%@\" (%p) is unknown on \"%@\"", NSStringFromSelector( action_), (void *) action_, [target class]);
814 816
    
815 817
    // remember varargs, there can be more arguments
816 818
    m = [signature numberOfArguments];
... ...
@@ -868,30 +870,34 @@ static void   *numberBuffer( char *type, NSNumber *value)
868 870
    length = [signature methodReturnLength];
869 871
    if( length)
870 872
    {
871
-      buf    = (id *) [[NSMutableData dataWithLength:length] mutableBytes];
873
+      if( length >= 1024)
874
+         buf = (id *) [[NSMutableData dataWithLength:length] mutableBytes];
875
+      else
876
+         buf = alloca( length);
877
+      
872 878
       [invocation getReturnValue:buf];
873 879
       
874
-      returnType =  (char *) [signature methodReturnType];
880
+      returnType = (char *) [signature methodReturnType];
875 881
       returnType = _NSObjCSkipRuntimeTypeQualifier( returnType);
876 882
       
877 883
       switch( *returnType)
878 884
       {
879 885
       case _C_ID       : result = *buf; break;
880 886
       case _C_CLASS    : result = *buf; break;
881
-      case _C_SEL      : result = [NSValue valueWithPointer:*(SEL *) buf]; break;
882
-      case _C_CHARPTR  : result = [NSString stringWithCString:(char *) buf]; break;
883
-      case _C_CHR      : result = [NSNumber numberWithChar:*(char *) buf]; break;
884
-      case _C_UCHR     : result = [NSNumber numberWithUnsignedChar:*(unsigned char *) buf]; break;
885
-      case _C_SHT      : result = [NSNumber numberWithShort:*(short *) buf]; break;
887
+      case _C_SEL      : result = [NSValue valueWithPointer:        (void *) *(SEL *) buf]; break;
888
+      case _C_CHARPTR  : result = [NSString stringWithCString:      (char *) buf]; break;
889
+      case _C_CHR      : result = [NSNumber numberWithChar:         *(char *) buf]; break;
890
+      case _C_UCHR     : result = [NSNumber numberWithUnsignedChar: *(unsigned char *) buf]; break;
891
+      case _C_SHT      : result = [NSNumber numberWithShort:        *(short *) buf]; break;
886 892
       case _C_USHT     : result = [NSNumber numberWithUnsignedShort:*(unsigned short *) buf]; break;
887
-      case _C_INT      : result = [NSNumber numberWithInt:*(int *) buf]; break;
888
-      case _C_UINT     : result = [NSNumber numberWithUnsignedInt:*(unsigned int *) buf]; break;
889
-      case _C_LNG      : result = [NSNumber numberWithLong:*(long *) buf]; break;
890
-      case _C_ULNG     : result = [NSNumber numberWithUnsignedLong:*(unsigned long *) buf]; break;
891
-      case _C_LNG_LNG  : result = [NSNumber numberWithLongLong:*(long long *) buf]; break;
893
+      case _C_INT      : result = [NSNumber numberWithInt:          *(int *) buf]; break;
894
+      case _C_UINT     : result = [NSNumber numberWithUnsignedInt:  *(unsigned int *) buf]; break;
895
+      case _C_LNG      : result = [NSNumber numberWithLong:         *(long *) buf]; break;
896
+      case _C_ULNG     : result = [NSNumber numberWithUnsignedLong: *(unsigned long *) buf]; break;
897
+      case _C_LNG_LNG  : result = [NSNumber numberWithLongLong:     *(long long *) buf]; break;
892 898
       case _C_ULNG_LNG : result = [NSNumber numberWithUnsignedLongLong:*(unsigned long long *) buf]; break;
893
-      case _C_FLT      : result = [NSNumber numberWithFloat:*(float *) buf]; break;
894
-      case _C_DBL      : result = [NSNumber numberWithDouble:*(double *) buf]; break;
899
+      case _C_FLT      : result = [NSNumber numberWithFloat:        *(float *) buf]; break;
900
+      case _C_DBL      : result = [NSNumber numberWithDouble:       *(double *) buf]; break;
895 901
 #ifdef _C_LNG_DBL
896 902
             //   case _C_LNG_DBL  : result = [NSNumber numberWithLongDouble: *(long double *) buf]; break;
897 903
 #endif
... ...
@@ -1050,7 +1056,7 @@ static void   *numberBuffer( char *type, NSNumber *value)
1050 1056
                     dataSource:(id <MulleScionDataSource>) dataSource
1051 1057
 {
1052 1058
    NSParameterAssert( value_ != nil);
1053
-   return( [NSValue valueWithPointer:NSSelectorFromString( value_)]);
1059
+   return( [NSValue valueWithPointer:(void *) NSSelectorFromString( value_)]);
1054 1060
 }
1055 1061
 
1056 1062
 @end
... ...
@@ -2311,7 +2317,7 @@ static NSBundle  *search( NSFileManager *manager, NSString *identifier, NSString
2311 2317
    {
2312 2318
       if( ! [[[rover fileAttributes] objectForKey:NSFileType] isEqualToString:NSFileTypeDirectory])
2313 2319
          continue;
2314
-      [rover skipDescendents];
2320
+      [rover skipDescendants];
2315 2321
          
2316 2322
       if( extension && ! [[item pathExtension] isEqualToString:extension])
2317 2323
          continue;
... ...
@@ -43,6 +43,7 @@
43 43
 # define MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
44 44
 #endif
45 45
 
46
+#pragma mark -
46 47
 //
47 48
 // after template expansion a MulleScionObject won't be mutated
48 49
 // by MulleScion
... ...
@@ -97,6 +98,7 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
97 98
 @end
98 99
 
99 100
 
101
+#pragma mark -
100 102
 @interface MulleScionValueObject : MulleScionObject
101 103
 {
102 104
    id    value_;         // convenient to serialize
... ...
@@ -107,6 +109,7 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
107 109
 @end
108 110
 
109 111
 
112
+#pragma mark -
110 113
 //
111 114
 // these objects can appear a few times in a template tree structure
112 115
 // they reset the fileName on occasion (for includes)
... ...
@@ -119,6 +122,7 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
119 122
 @end
120 123
 
121 124
 
125
+#pragma mark -
122 126
 @interface MulleScionPlainText : MulleScionValueObject
123 127
 
124 128
 + (id) newWithRetainedString:(NSString *) NS_CONSUMED s
... ...
@@ -129,12 +133,13 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
129 133
 @end
130 134
 
131 135
 
136
+#pragma mark -
132 137
 @interface MulleScionExpression : MulleScionValueObject
133 138
 @end
134 139
 
135 140
 
136
-
137
-// if nil, it's nil...
141
+#pragma mark -
142
+// if nil, you know it's nil...
138 143
 
139 144
 @interface MulleScionNumber : MulleScionExpression
140 145
 
... ...
@@ -143,6 +148,7 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
143 148
 
144 149
 @end
145 150
 
151
+#pragma mark -
146 152
 
147 153
 @interface MulleScionString : MulleScionExpression
148 154
 
... ...
@@ -152,10 +158,13 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
152 158
 @end
153 159
 
154 160
 
161
+#pragma mark -
162
+
155 163
 @interface MulleScionSelector : MulleScionString
156 164
 @end
157 165
 
158 166
 
167
+#pragma mark -
159 168
 @interface MulleScionArray : MulleScionExpression
160 169
 
161 170
 + (id) newWithArray:(NSArray *) s
... ...
@@ -164,6 +173,7 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
164 173
 @end
165 174
 
166 175
 
176
+#pragma mark -
167 177
 @interface MulleScionDictionary : MulleScionExpression
168 178
    
169 179
 + (id) newWithDictionary:(NSDictionary *) s
... ...
@@ -172,6 +182,7 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
172 182
 @end
173 183
 
174 184
 
185
+#pragma mark -
175 186
 @interface MulleScionIdentifierExpression : MulleScionExpression
176 187
 
177 188
 + (id) newWithIdentifier:(NSString *) s
... ...
@@ -182,10 +193,12 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
182 193
 @end
183 194
 
184 195
 
196
+#pragma mark -
185 197
 @interface MulleScionVariable : MulleScionIdentifierExpression
186 198
 @end
187 199
 
188 200
 
201
+#pragma mark -
189 202
 @interface MulleScionOperatorExpression : MulleScionExpression
190 203
 
191 204
 - (NSString *) operator;
... ...
@@ -193,6 +206,7 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
193 206
 @end
194 207
 
195 208
 
209
+#pragma mark -
196 210
 @interface MulleScionUnaryOperatorExpression : MulleScionOperatorExpression
197 211
 
198 212
 + (id) newWithRetainedExpression:(MulleScionExpression *) NS_CONSUMED left
... ...
@@ -200,10 +214,12 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
200 214
 @end
201 215
 
202 216
 
217
+#pragma mark -
203 218
 @interface MulleScionNot  : MulleScionUnaryOperatorExpression
204 219
 @end
205 220
 
206 221
 
222
+#pragma mark -
207 223
 @interface MulleScionBinaryOperatorExpression : MulleScionOperatorExpression
208 224
 {
209 225
    MulleScionExpression   *right_;
... ...
@@ -218,19 +234,25 @@ MULLE_SCION_OBJECT_NEXT_POINTER_VISIBILITY
218 234
 @end
219 235
 
220 236
 
237
+#pragma mark -
221 238
 @interface MulleScionAnd  : MulleScionBinaryOperatorExpression
222 239
 @end
223 240
 
241
+#pragma mark -
224 242
 @interface MulleScionOr   : MulleScionBinaryOperatorExpression
225 243
 @end
226 244
 
245
+#pragma mark -
227 246
 @interface MulleScionPipe : MulleScionBinaryOperatorExpression
228 247
 @end
229 248
 
249
+#pragma mark -
230 250
 @interface MulleScionIndexing : MulleScionBinaryOperatorExpression
231 251
 @end
232 252
 
233 253
 
254
+#pragma mark -
255
+
234 256
 typedef enum
235 257
 {
236 258
    MulleScionEqual,
... ...
@@ -254,10 +276,12 @@ typedef enum
254 276
                           lineNumber:(NSUInteger) nr;
255 277
 @end
256 278
 
279
+#pragma mark -
257 280
 // might go away, it's a kludge (for NSRange really)
258 281
 @interface MulleScionDot : MulleScionBinaryOperatorExpression
259 282
 @end
260 283
 
284
+#pragma mark -
261 285
 
262 286
 @interface MulleScionFunction : MulleScionIdentifierExpression
263 287
 {
... ...
@@ -272,6 +296,7 @@ typedef enum
272 296
 
273 297
 @end
274 298
 
299
+#pragma mark -
275 300
 
276 301
 // is this really an expression ???
277 302
 @interface MulleScionParameterAssignment : MulleScionIdentifierExpression
... ...
@@ -289,6 +314,7 @@ typedef enum
289 314
 @end
290 315
 
291 316
 
317
+#pragma mark -
292 318
 //
293 319
 // used in if, while. NOT used in set/for and also not used as a
294 320
 // subexpression
... ...
@@ -304,6 +330,7 @@ typedef enum
304 330
 @end
305 331
 
306 332
 
333
+#pragma mark -
307 334
 @interface MulleScionMethod : MulleScionExpression
308 335
 {
309 336
    SEL       action_;
... ...
@@ -320,7 +347,8 @@ typedef enum
320 347
 @end
321 348
 
322 349
 
323
-// 
350
+#pragma mark -
351
+//
324 352
 @interface MulleScionConditional : MulleScionExpression
325 353
 {
326 354
    MulleScionExpression   *middle_;
... ...
@@ -334,6 +362,7 @@ typedef enum
334 362
 @end
335 363
 
336 364
 
365
+#pragma mark -
337 366
 //
338 367
 // Commands do not print anything
339 368
 //
... ...
@@ -347,15 +376,18 @@ typedef enum
347 376
 @end
348 377
 
349 378
 
379
+#pragma mark -
350 380
 @interface MulleScionTerminator : MulleScionCommand
351 381
 @end
352 382
 
353 383
 
354 384
 
385
+#pragma mark -
355 386
 @interface MulleScionEndFor : MulleScionTerminator
356 387
 @end
357 388
 
358 389
 
390
+#pragma mark -
359 391
 @interface MulleScionExpressionCommand : MulleScionCommand
360 392
 {
361 393
    MulleScionExpression   *expression_;
... ...
@@ -367,10 +399,12 @@ typedef enum
367 399
 @end
368 400
 
369 401
 
402
+#pragma mark -
370 403
 @interface MulleScionLog : MulleScionExpressionCommand
371 404
 @end
372 405
 
373 406
 
407
+#pragma mark -
374 408
 @interface MulleScionSet : MulleScionCommand
375 409
 {
376 410
    MulleScionExpression   *left_;
... ...
@@ -384,36 +418,44 @@ typedef enum
384 418
 @end
385 419
 
386 420
 
421
+#pragma mark -
387 422
 // "for" is pretty much the same as an assignment, just looped
388 423
 @interface MulleScionFor : MulleScionSet
389 424
 @end
390 425
 
426
+#pragma mark -
391 427
 
392 428
 @interface MulleScionIf : MulleScionExpressionCommand
393 429
 @end
394 430
 
431
+#pragma mark -
395 432
 
396 433
 @interface MulleScionElse : MulleScionTerminator
397 434
 @end
398 435
 
436
+#pragma mark -
399 437
 
400 438
 @interface MulleScionElseFor : MulleScionElse
401 439
 @end
402 440
 
441
+#pragma mark -
403 442
 
404 443
 @interface MulleScionEndIf : MulleScionTerminator
405 444
 @end
406 445
 
407 446
 
447
+#pragma mark -
408 448
 // "while" is pretty much the same as an 'if', just looped
409 449
 
410 450
 @interface MulleScionWhile : MulleScionIf
411 451
 @end
412 452
 
453
+#pragma mark -
413 454
 
414 455
 @interface MulleScionEndWhile : MulleScionTerminator
415 456
 @end
416 457
 
458
+#pragma mark -
417 459
 
418 460
 @interface MulleScionBlock : MulleScionCommand
419 461
 {
... ...
@@ -430,19 +472,24 @@ typedef enum
430 472
 
431 473
 @end
432 474
 
475
+#pragma mark -
433 476
 
434 477
 @interface MulleScionEndBlock : MulleScionTerminator
435 478
 @end
436 479
 
480
+#pragma mark -
437 481
 
438 482
 @interface MulleScionMethodCall : MulleScionExpressionCommand
439 483
 @end
440 484
 
485
+#pragma mark -
441 486
 
442 487
 @interface MulleScionFunctionCall : MulleScionExpressionCommand
443 488
 @end
444 489
 
445 490
 
491
+#pragma mark -
492
+
446 493
 enum
447 494
 {
448 495
    FilterPlaintext          = 0x1,
... ...
@@ -450,6 +497,7 @@ enum
450 497
    FilterApplyStackedFilters = 0x4
451 498
 };
452 499
 
500
+
453 501
 @interface MulleScionFilter : MulleScionExpressionCommand
454 502
 {
455 503
    unsigned int   _flags;
... ...
@@ -460,10 +508,12 @@ enum
460 508
                       lineNumber:(NSUInteger) nr;
461 509
 @end
462 510
 
511
+#pragma mark -
463 512
 
464 513
 @interface MulleScionEndFilter : MulleScionTerminator
465 514
 @end
466 515
 
516
+#pragma mark -
467 517
 
468 518
 @interface MulleScionMacro : MulleScionTemplate
469 519
 {
... ...
@@ -484,6 +534,7 @@ enum
484 534
 
485 535
 @end
486 536
 
537
+#pragma mark -
487 538
 
488 539
 @interface MulleScionRequires : MulleScionCommand
489 540
 {
... ...
@@ -155,7 +155,7 @@ NS_RETURNS_RETAINED static id   newMulleScionValueObject( Class self, id value,
155 155
 {
156 156
    MulleScionValueObject   *p;
157 157
    
158
-   p = [self newWithLineNumber:nr];
158
+   p         = [self newWithLineNumber:nr];
159 159
    p->value_ = [value copy];
160 160
    return( p);
161 161
 }
... ...
@@ -265,7 +265,7 @@ NS_RETURNS_RETAINED static id   newMulleScionValueObject( Class self, id value,
265 265
    
266 266
    NSParameterAssert( [s isKindOfClass:[NSString class]]);
267 267
 
268
-   p = newMulleScionValueObject( self, nil, nr);
268
+   p         = newMulleScionValueObject( self, nil, nr);
269 269
    p->value_ = s;
270 270
    return( p);
271 271
 }
... ...
@@ -473,6 +473,24 @@ NS_RETURNS_RETAINED static id   newMulleScionValueObject( Class self, id value,
473 473
 }
474 474
 
475 475
 
476
+#if DEBUG
477
+- (void) release
478
+{
479
+   [super release];
480
+}
481
+
482
+- (id) retain
483
+{
484
+   return( [super retain]);
485
+}
486
+
487
+
488
+- (id) autorelease
489
+{
490
+   return( [super autorelease]);
491
+}
492
+#endif
493
+
476 494
 - (BOOL) isMethod
477 495
 {
478 496
    return( YES);
... ...
@@ -560,7 +578,7 @@ NS_RETURNS_RETAINED static id   newMulleScionValueObject( Class self, id value,
560 578
    
561 579
    NSParameterAssert( [expr isKindOfClass:[MulleScionExpression class]]);
562 580
    
563
-   p = newMulleScionValueObject( self, nil, nr);
581
+   p         = newMulleScionValueObject( self, nil, nr);
564 582
    p->value_ = expr;
565 583
    return( p);
566 584
 }
... ...
@@ -64,3 +64,15 @@ typedef struct
64 64
 
65 65
 
66 66
 @end
67
+
68
+
69
+typedef struct
70
+{
71
+   void         *parser;
72
+   NSString     *fileName;
73
+   NSUInteger   lineNumber;
74
+   NSString     *message;
75
+} parser_warning_info;
76
+
77
+typedef parser_warning_info   parser_error_info;
78
+
... ...
@@ -48,6 +48,24 @@
48 48
 
49 49
 @implementation MulleScionParser ( Parsing)
50 50
 
51
+
52
+- (void) parserWarning:(parser_warning_info *) info
53
+{
54
+   [self parser:info->parser
55
+warningInFileName:info->fileName ? info->fileName : @"template"
56
+     lineNumber:info->lineNumber
57
+         reason:info->message];
58
+}
59
+
60
+
61
+- (void) parserError:(parser_error_info *) info
62
+{
63
+   [self parser:info->parser
64
+errorInFileName:info->fileName ? info->fileName : @"template"
65
+     lineNumber:info->lineNumber
66
+         reason:info->message];
67
+}
68
+
51 69
 // parse it a little like Twig
52 70
 // {# comment #}
53 71
 // {{ identifier }}
... ...
@@ -100,8 +118,8 @@ typedef struct _parser
100 118
    
101 119
    MulleScionObject     *first;
102 120
 
103
-   void                 (*parser_do_error)( id self, SEL sel, void *parser, NSString *filename, NSUInteger line, NSString *message);
104
-   void                 (*parser_do_warning)( id self, SEL sel, void *parser, NSString *filename, NSUInteger line, NSString *message);
121
+   void                 (*parser_do_error)( id self, SEL sel, parser_warning_info *parser);
122
+   void                 (*parser_do_warning)( id self, SEL sel, parser_error_info *parser);
105 123
    id                   self;
106 124
    SEL                  sel;
107 125
    int                  skipComments;
... ...
@@ -159,16 +177,16 @@ static void   parser_init( parser *p, unsigned char *buf, size_t len)
159 177
 
160 178
 static inline void   parser_set_warning_callback( parser *p, id self, SEL sel)
161 179
 {
162
-   p->self        = self;
163
-   p->sel         = sel;
180
+   p->self              = self;
181
+   p->sel               = sel;
164 182
    p->parser_do_warning = (void *) [p->self methodForSelector:sel];
165 183
 }
166 184
 
167 185
 
168 186
 static inline void   parser_set_error_callback( parser *p, id self, SEL sel)
169 187
 {
170
-   p->self        = self;
171
-   p->sel         = sel;
188
+   p->self            = self;
189
+   p->sel             = sel;
172 190
    p->parser_do_error = (void *) [p->self methodForSelector:sel];
173 191
 }
174 192
 
... ...
@@ -234,6 +252,9 @@ static NSString   *parser_diagnostic_string( parser *p, NSString *reason)
234 252
    s_len  = p_len >= 6 ? 12 : 12 + 6 - p_len;
235 253
    prefix = &p->curr[ -p_len];
236 254
    suffix = &p->curr[ 1];
255
+
256
+   if( suffix > p->sentinel)
257
+      suffix = p->sentinel;
237 258
    
238 259
    if( prefix < p->buf)
239 260
    {
... ...
@@ -242,7 +263,7 @@ static NSString   *parser_diagnostic_string( parser *p, NSString *reason)
242 263
    }
243 264
    
244 265
    if( &suffix[ s_len] > p->sentinel)
245
-      s_len  = p->sentinel - p->curr;
266
+      s_len  = p->sentinel - suffix;
246 267
    
247 268
    // stop tail at linefeed
248 269
    for( i = 0; i < s_len; i++)
... ...
@@ -278,20 +299,29 @@ static NSString   *parser_diagnostic_string( parser *p, NSString *reason)
278 299
 
279 300
 static void  parser_warning( parser *p, char *c_format, ...)
280 301
 {
281
-   NSString       *reason;
282
-   NSString       *s;
283
-   va_list        args;
302
+   NSString              *reason;
303
+   parser_warning_info   info;
304
+   va_list               args;
284 305
    
285
-   if( p->parser_do_warning)
286
-   {
287
-      va_start( args, c_format);
288
-      reason = [[[NSString alloc] initWithFormat:[NSString stringWithCString:c_format]
289
-                                       arguments:args] autorelease];
290
-      va_end( args);
306
+   if( ! p->parser_do_warning)
307
+      return;
308
+   
309
+   va_start( args, c_format);
310
+#ifdef __MULLE_OBJC_RUNTIME__
311
+   reason = [[[NSString alloc] initWithFormat:[NSString stringWithCString:c_format]
312
+                                      va_list:args] autorelease];
313
+#else
314
+   reason = [[[NSString alloc] initWithFormat:[NSString stringWithCString:c_format]
315
+                                    arguments:args] autorelease];
316
+#endif
317
+   va_end( args);
318
+   
319
+   info.parser     = p;
320
+   info.lineNumber = p->memo.lineNumber;
321
+   info.message    = parser_diagnostic_string( p, reason);
322
+   info.fileName   = p->fileName;
291 323
 
292
-      s = parser_diagnostic_string( p, reason);
293
-      (*p->parser_do_warning)( p->self, p->sel, p, p->fileName, p->memo.lineNumber, s);
294
-   }
324
+   (*p->parser_do_warning)( p->self, p->sel, &info);
295 325
 }
296 326
 
297 327
 
... ...
@@ -300,24 +330,32 @@ static void  parser_warning( parser *p, char *c_format, ...)
300 330
 //
301 331
 static void  MULLE_NO_RETURN  parser_error( parser *p, char *c_format, ...)
302 332
 {
303
-   NSString       *reason;
304
-   NSString       *s;
305
-   va_list        args;
333
+   NSString            *reason;
334
+   parser_error_info   info;
335
+   va_list             args;
306 336
    
307
-   if( p->parser_do_error)
308
-   {
309
-      va_start( args, c_format);
310
-      reason = [[[NSString alloc] initWithFormat:[NSString stringWithCString:c_format]
311
-                                       arguments:args] autorelease];
312
-      va_end( args);
337
+   if( ! p->parser_do_error)
338
+      abort();
339
+   
340
+   va_start( args, c_format);
341
+#ifdef __MULLE_OBJC_RUNTIME__
342
+   reason = [[[NSString alloc] initWithFormat:[NSString stringWithCString:c_format]
343
+                                     va_list:args] autorelease];
344
+#else
345
+   reason = [[[NSString alloc] initWithFormat:[NSString stringWithCString:c_format]
346
+                                    arguments:args] autorelease];
347
+#endif
348
+   va_end( args);
313 349
 
314
-      s = parser_diagnostic_string( p, reason);
315
-      (*p->parser_do_error)( p->self, p->sel, p, p->fileName, p->memo.lineNumber, s);
316
-   }
317
-   abort();
350
+   info.parser     = p;
351
+   info.lineNumber = p->memo.lineNumber;
352
+   info.message    = parser_diagnostic_string( p, reason);
353
+   info.fileName   = p->fileName;
354
+   
355
+   (*p->parser_do_error)( p->self, p->sel, &info);
318 356
 }
319 357
 
320
-   
358
+
321 359
 static unsigned char    *unescaped_string_if_needed( unsigned char *s,
322 360
                                                      NSUInteger len,
323 361
                                                      NSUInteger *result_len)
... ...
@@ -1294,7 +1332,7 @@ static NSMutableArray   *parser_do_arguments( parser *p)
1294 1332
 static MulleScionMethod  * NS_RETURNS_RETAINED parser_do_method( parser *p)
1295 1333
 {
1296 1334
    NSMutableString        *selBuf;
1297
-   NSString              *selName;
1335
+   NSString               *selName;
1298 1336
    NSMutableArray         *arguments;
1299 1337
    NSUInteger             line;
1300 1338
    MulleScionExpression   *target;
... ...
@@ -2557,7 +2595,7 @@ static MulleScionObject  * NS_RETURNS_RETAINED   parser_do_define( parser *p, NS
2557 2595
    expr = parser_do_expression( p);
2558 2596
    
2559 2597
    [p->tables.definitionTable setObject:expr
2560
-                          forKey:identifier];
2598
+                                 forKey:identifier];
2561 2599
    [expr release];
2562 2600
    
2563 2601
    return( nil);
... ...
@@ -3067,8 +3105,8 @@ retry:
3067 3105
    parser_set_definitions_table( &parser, tables->definitionTable);
3068 3106
    parser_set_macro_table( &parser, tables->macroTable);
3069 3107
    parser_set_dependency_table( &parser, tables->dependencyTable);
3070
-   parser_set_error_callback( &parser, self, @selector( parser:errorInFileName:lineNumber:reason:));
3071
-   parser_set_warning_callback( &parser, self, @selector( parser:warningInFileName:lineNumber:reason:));
3108
+   parser_set_error_callback( &parser, self, @selector( parserError:));
3109
+   parser_set_warning_callback( &parser, self, @selector( parserWarning:));
3072 3110
 
3073 3111
    //
3074 3112
    // this make it possible to have scion templates as executable unix scripts
... ...
@@ -63,6 +63,11 @@ errorInFileName:(NSString *) fileName
63 63
      lineNumber:(NSUInteger) lineNumber
64 64
          reason:(NSString *) reason;
65 65
 
66
+- (void) parser:(void *) parser
67
+warningInFileName:(NSString *) fileName
68
+     lineNumber:(NSUInteger) lineNumber
69
+         reason:(NSString *) reason;
70
+
66 71
 - (NSString *) fileName;
67 72
 
68 73
 @end
... ...
@@ -84,7 +84,6 @@
84 84
    if( ! data)
85 85
    {
86 86
       NSLog( @"%@", error);
87
-      [self autorelease];
88 87
       return( nil);
89 88
    }
90 89
    
... ...
@@ -99,8 +98,8 @@
99 98
    NSData            *data;
100 99
    MulleScionParser  *parser;
101 100
    
102
-   data = [[[NSData alloc] initWithBytesNoCopy:s
103
-                                       length:strlen( s)
101
+   data = [[[NSData alloc] initWithBytesNoCopy:(char *) s
102
+                                       length:strlen( (char *) s)
104 103
                                  freeWhenDone:NO] autorelease];
105 104
    parser = [[[self alloc] initWithData:data
106 105
                                fileName:@"unknown.scion"] autorelease];
... ...
@@ -117,7 +116,7 @@
117 116
    data = [NSData dataWithContentsOfMappedFile:path];
118 117
    if( ! data)
119 118
    {
120
-      [self autorelease];
119
+      NSLog( @"Could not open template file \"%@\"", path);
121 120
       return( nil);
122 121
    }
123 122
    
... ...
@@ -45,7 +45,7 @@
45 45
 @interface MulleScionPrinter : NSObject
46 46
 {
47 47
    id            dataSource_;
48
-   NSDictionary  *defaultlocals_;
48
+   NSDictionary  *defaultLocals_;
49 49
 }
50 50
 
51 51
 - (id) initWithDataSource:(id) dataSource;
... ...
@@ -54,8 +54,8 @@
54 54
 - (void) writeToOutput:(id <MulleScionOutput>) output
55 55
               template:(MulleScionTemplate *) template;
56 56
 
57
-- (NSDictionary *) defaultlocals;
58
-- (void) setDefaultlocalVariables:(NSDictionary *) dictionary;
57
+- (NSDictionary *) defaultLocalVariables;
58
+- (void) setDefaultLocalVariables:(NSDictionary *) dictionary;
59 59
 
60 60
 
61 61
 @end
... ...
@@ -39,6 +39,7 @@
39 39
 
40 40
 #import "MulleScionObjectModel.h"
41 41
 #import "MulleScionObjectModel+Printing.h"
42
+#import "MulleCommonObjCRuntime.h"
42 43
 
43 44
 
44 45
 
... ...
@@ -50,7 +51,7 @@
50 51
 
51 52
    if( ! dataSource)
52 53
    {
53
-      [self autorelease];
54
+      [self release];
54 55
       return( nil);
55 56
    }
56 57
    dataSource_  = dataSource;
... ...
@@ -63,7 +64,7 @@
63 64
 - (void) dealloc
64 65
 {
65 66
    [dataSource_ release];
66
-   [defaultlocals_ release];
67
+   [defaultLocals_ release];
67 68
 
68 69
    // Instruments apparently lies cold blooded :)
69 70
    //NSLog( @"<%@ %p is dead>", MulleGetClass( self), self);
... ...
@@ -71,16 +72,16 @@
71 72
 }
72 73
 
73 74
 
74
-- (NSDictionary *) defaultlocals
75
+- (NSDictionary *) defaultLocalVariables
75 76
 {
76
-   return( defaultlocals_);
77
+   return( defaultLocals_);
77 78
 }
78 79
 
79 80
 
80
-- (void) setDefaultlocalVariables:(NSDictionary *) dictionary
81
+- (void) setDefaultLocalVariables:(NSDictionary *) dictionary
81 82
 {
82
-   [defaultlocals_ autorelease];
83
-   defaultlocals_ = [dictionary copy];
83
+   [defaultLocals_ autorelease];
84
+   defaultLocals_ = [dictionary copy];
84 85
 }
85 86
 
86 87
 
... ...
@@ -91,7 +92,7 @@
91 92
    
92 93
    NSParameterAssert( [template isKindOfClass:[MulleScionTemplate class]]);
93 94
 
94
-   locals = [template localVariablesWithDefaultValues:[self defaultlocals]];
95
+   locals = [template localVariablesWithDefaultValues:[self defaultLocalVariables]];
95 96
    
96 97
    NSParameterAssert( locals);  // could raise if Apple starts hating on nil
97 98
    [template renderInto:output
... ...
@@ -33,8 +33,6 @@
33 33
 //  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 34
 //  POSSIBILITY OF SUCH DAMAGE.
35 35
 //
36
-
37
-
38 36
 #import "MulleScionPrintingException.h"
39 37
 
40 38
 #import "MulleScionObjectModel+Printing.h"
... ...
@@ -51,8 +49,14 @@ void  MULLE_NO_RETURN   MulleScionPrintingException( NSString *exceptionName, NS
51 49
    NSCParameterAssert( [format isKindOfClass:[NSString class]]);
52 50
    
53 51
    va_start( args, format);
52
+   
53
+#ifdef __MULLE_OBJC_RUNTIME__
54
+   s = [[[NSString alloc] initWithFormat:format
55
+                               va_list:args] autorelease];
56
+#else
54 57
    s = [[[NSString alloc] initWithFormat:format
55 58
                                arguments:args] autorelease];
59
+#endif
56 60
    
57 61
    va_end( args);
58 62
    
... ...
@@ -37,6 +37,8 @@
37 37
 
38 38
 #import "MulleScionTemplate+CompressedArchive.h"
39 39
 
40
+#include <fcntl.h>
41
+
40 42
 
41 43
 #ifdef HAVE_ZLIB
42 44
 # undef HAVE_ZLIB
... ...
@@ -235,15 +237,15 @@ static id   _newWithContentsOfArchive( NSString *fileName, NSAutoreleasePool **p
235 237
 - (id) initWithContentsOfArchive:(NSString *) fileName
236 238
 {
237 239
    NSAutoreleasePool   *pool;
238
-   MulleScionTemplate  *root;
239
-   
240
-   [self autorelease];
241 240
    
242 241
    pool = [NSAutoreleasePool new];
243
-   root = _newWithContentsOfArchive( fileName, &pool);
242
+
243
+   [self release];
244
+   self = _newWithContentsOfArchive( fileName, &pool);
245
+
244 246
    [pool release];
245 247
 
246
-   return( root);
248
+   return( self);
247 249
 }
248 250
 
249 251
 
... ...
@@ -392,7 +392,6 @@ static int   _archive_main( int argc, const char * argv[], int keyed)
392 392
    NSDictionary         *info;
393 393
    NSEnumerator         *rover;
394 394
    NSString             *archiveName;
395
-   NSString             *fileName;
396 395
 
397 396
    arguments = [[NSProcessInfo processInfo] arguments];
398 397
    rover     = [arguments objectEnumerator];
... ...
@@ -406,7 +405,7 @@ static int   _archive_main( int argc, const char * argv[], int keyed)
406 405
    if( [archiveName isEqualToString:@"-"])
407 406
       return( -3);
408 407
 
409
-   template = acquireTemplateFromPath( fileName);
408
+   template = acquireTemplateFromPath( archiveName);
410 409
 
411 410
    if( ! template)
412 411
       return( -1);
... ...
@@ -424,8 +423,8 @@ static int   _archive_main( int argc, const char * argv[], int keyed)
424 423
 
425 424
 static int   _main(int argc, const char * argv[])
426 425
 {
427
-   NSDictionary   *info;
428
-   NSFileHandle   *stream;
426
+   NSDictionary         *info;
427
+   NSFileHandle         *stream;
429 428
    MulleScionTemplate   *template;
430 429
 
431 430
    info = getInfoFromArguments();
432 431
new file mode 100644
... ...
@@ -0,0 +1,4 @@
1
+{# just a minimal template  #}
2
+{% foo = "Bochum" %}
3
+VfL {{ foo }} 1848
4
+
0 5
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+{{ [@"ho&ho&" htmlEscapedString] }}
0 2
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+ho&amp;ho&amp;
0 2
new file mode 120000
... ...
@@ -0,0 +1 @@
1
+run-test.sh
0 2
\ No newline at end of file
1 3
deleted file mode 120000
... ...
@@ -1 +0,0 @@
1
-run-all-scion-tests.sh
2 0
\ No newline at end of file
3 1
similarity index 99%
4 2
rename from tests/run-all-scion-tests.sh
5 3
rename to tests/run-test.sh
... ...
@@ -11,7 +11,7 @@
11 11
 executable=`basename $0`
12 12
 executable=`basename $executable .sh`
13 13
 
14
-if [ "$executable" = "run-all-scion-tests" ]
14
+if [ "$executable" = "run-all-tests" ]
15 15
 then
16 16
    TEST=""
17 17
    VERBOSE=yes