Browse code

Merge commit '07d4a6c35fd5106bf0fb201ece816c8b6c82aa56' Fix usage once more

Nat! authored on 13/06/2017 11:47:14
Showing 49 changed files
... ...
@@ -1 +1 @@
1
-#gitolite.mulle-kybernetik.com:MulleFoundation
1
+https://github.com/madler/zlib.git
... ...
@@ -1,23 +1,32 @@
1 1
 .DS_Store
2
-project.xcworkspace/
3
-xcuserdata/
4
-*.pch
5
-dox/html/
6
-*~
7
-Build
8
-build
2
+
9 3
 *.gz
4
+*.pch
10 5
 *.uncrustify
11
-github*.json
12
-.idea/
13
-google-toolbox-for-mac/
14 6
 *.xxx
15
-tests/compare-parse-speed-to-unarchive-speed.sh
7
+*~
8
+
16 9
 .bootstrap.auto/
17 10
 .bootstrap.local/
18
-dependencies/
11
+.idea/
19 12
 .repos/
20
-mulle-configuration/
21
-addictions//.bootstrap.repos
13
+.bootstrap.repos/
14
+
22 15
 /addictions
23
-/.bootstrap.repos
16
+/bin
17
+/include
18
+/lib
19
+/stashes
20
+Build/
21
+build/
22
+dependencies/
23
+dox/html/
24
+github*.json
25
+google-toolbox-for-mac/
26
+mulle-configuration/
27
+project.xcworkspace/
28
+tests/bin/
29
+tests/compare-parse-speed-to-unarchive-speed.sh
30
+tests/include/
31
+tests/lib/
32
+xcuserdata/
... ...
@@ -6,13 +6,34 @@ project (MulleScion)
6 6
 set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/mulle-configuration)
7 7
 message(STATUS "CMAKE_MODULE_PATH is ${CMAKE_MODULE_PATH}")
8 8
 message(STATUS "CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
9
+
10
+set( MULLE_LANGUAGE "ObjC")
11
+
9 12
 if( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
10 13
   include( Debug)
11 14
 else()
12 15
   include( Release)
13 16
 endif()
14 17
 
18
+include( CMakeSourcesAndHeaders.txt )
19
+
20
+set( GOOGLE_TOOLBOX_SOURCES
21
+"google-toolbox-for-mac/Foundation/GTMNSString+HTML.m"
22
+)
23
+
24
+
25
+set( HEADERS
26
+${MULLE_SCION_HEADERS}
27
+${MULLE_SCION_FOUNDATION_HEADERS}
28
+${MULLE_SCION_PARSER_HEADERS}
29
+${MULLE_SCION_PRINTER_HEADERS}
30
+)
31
+
32
+# move to mulle-configuration ?
33
+set( CMAKE_FIND_FRAMEWORK "LAST")
34
+
15 35
 find_library( FOUNDATION_LIBRARY NAMES Foundation)
36
+message( STATUS "FOUNDATION_LIBRARY is ${FOUNDATION_LIBRARY}")
16 37
 FIND_PACKAGE( ZLIB REQUIRED)
17 38
 
18 39
 message( STATUS "FOUNDATION_LIBRARY is ${FOUNDATION_LIBRARY}")
... ...
@@ -20,12 +41,6 @@ message( STATUS "ZLIB_LIBRARIES is ${ZLIB_LIBRARIES}")
20 20
 
21 21
 add_definitions( -DPROJECT_VERSION=1856)
22 22
 
23
-include( CMakeSourcesAndHeaders.txt )
24
-
25
-set( GOOGLE_TOOLBOX_SOURCES
26
-"google-toolbox-for-mac/Foundation/GTMNSString+HTML.m"
27
-)
28
-
29 23
 
30 24
 add_library( MulleScion STATIC
31 25
 ${MULLE_SCION_SOURCES}
... ...
@@ -43,14 +58,6 @@ ${TOOL_SOURCES}
43 43
 )
44 44
 
45 45
 
46
-set( HEADERS
47
-${MULLE_SCION_HEADERS}
48
-${MULLE_SCION_FOUNDATION_HEADERS}
49
-${MULLE_SCION_PARSER_HEADERS}
50
-${MULLE_SCION_PRINTER_HEADERS}
51
-)
52
-
53
-
54 46
 target_link_libraries( mulle-scion
55 47
 ${BEGIN_ALL_LOAD}
56 48
 MulleScion
... ...
@@ -64,6 +71,7 @@ ${OS_SPECIFIC_LIBS}
64 64
 
65 65
 # INSTALL( TARGETS MulleScion DESTINATION "lib")
66 66
 # INSTALL( FILES ${HEADERS} DESTINATION "include/MulleScion")
67
+
67 68
 INSTALL( TARGETS mulle-scion DESTINATION "bin")
68 69
 INSTALL( FILES ${SCIONS} DESTINATION "share/mulle-scion/dox")
69 70
 
... ...
@@ -143,4 +143,3 @@ dox/while.scion
143 143
 "dox/!_Introduction.scion"
144 144
 "dox/#!.scion"
145 145
 )
146
-
... ...
@@ -1019,18 +1019,18 @@
1019 1019
 		41D6DE9F16DE28B8004833D6 /* MulleScionPrinter */ = {
1020 1020
 			isa = PBXGroup;
1021 1021
 			children = (
1022
-				41D6DEA916DE3900004833D6 /* MulleScionOutputProtocol.h */,
1023 1022
 				4121DB1516DD8A0900BFD60C /* MulleScionDataSourceProtocol.h */,
1024 1023
 				41D6DEA716DE3374004833D6 /* MulleScionDataSourceProtocol.m */,
1024
+				41D6DEA916DE3900004833D6 /* MulleScionOutputProtocol.h */,
1025 1025
 				41764BA016DA51B700560FCF /* MulleScionPrinter.h */,
1026 1026
 				41764BA116DA51B700560FCF /* MulleScionPrinter.m */,
1027
+				41D6DEA316DE32A9004833D6 /* MulleScionPrintingException.h */,
1027 1028
 				41D6DEA416DE32A9004833D6 /* MulleScionPrintingException.m */,
1028 1029
 				41764BA816DA5B2B00560FCF /* MulleScionObjectModel+Printing.m */,
1029 1030
 				41764BAB16DA5E1600560FCF /* NSObject+MulleScionDescription.m */,
1030 1031
 				4121DB1016DD685C00BFD60C /* NSValue+CheatAndHack.m */,
1031 1032
 				410B32E916DB8A7D005D0EAD /* MulleMutableLineNumber.m */,
1032 1033
 				41F12D4516E274D200120E63 /* MulleScionNull.m */,
1033
-				41D6DEA316DE32A9004833D6 /* MulleScionPrintingException.h */,
1034 1034
 				41764BA716DA5B2B00560FCF /* MulleScionObjectModel+Printing.h */,
1035 1035
 				41764BAA16DA5E1600560FCF /* NSObject+MulleScionDescription.h */,
1036 1036
 				410B32E816DB8A7D005D0EAD /* MulleMutableLineNumber.h */,
... ...
@@ -47,11 +47,11 @@
47 47
 #endif
48 48
 
49 49
 
50
-#ifdef __MULLE_OBJC_RUNTIME__
50
+#ifdef __MULLE_OBJC__
51 51
 
52 52
 static inline Class   MulleGetClass( id self)
53 53
 {
54
-   return( mulle_objc_object_get_isa( self));
54
+   return( self ? (Class) _mulle_objc_object_get_isa( self) : Nil);
55 55
 }
56 56
 
57 57
 #else
... ...
@@ -70,7 +70,7 @@ static inline Class   MulleGetClass( id self)
70 70
 
71 71
 static inline Class   MulleGetClass( id self)
72 72
 {
73
-   return( ((__bridge struct objc_object *) self)->isa);
73
+   return( self ? ((__bridge struct objc_object *) self)->isa : Nil);
74 74
 }
75 75
 # endif
76 76
 #endif
... ...
@@ -1,5 +1,5 @@
1 1
 //
2
-//  NSLineCountNumber.h
2
+//  MulleMutableLineNumber.h
3 3
 //  MulleScion
4 4
 //
5 5
 //  Created by Nat! on 25.02.13.
... ...
@@ -1,5 +1,5 @@
1 1
 //
2
-//  NSLineCountNumber.m
2
+//  MulleMutableLineNumber.m
3 3
 //  MulleScion
4 4
 //
5 5
 //  Created by Nat! on 25.02.13.
... ...
@@ -40,6 +40,21 @@
40 40
 
41 41
 @implementation MulleMutableLineNumber
42 42
 
43
+// as we are "breaking out" of the class cluster, use standard
44
+// allocation
45
+
46
++ (instancetype) alloc
47
+{
48
+   return( NSAllocateObject( self, 0, NULL));
49
+}
50
+
51
+
52
++ (instancetype) allocWithZone:(NSZone *) zone
53
+{
54
+   return( NSAllocateObject( self, 0, NULL));
55
+}
56
+
57
+
43 58
 - (void) setUnsignedInteger:(NSUInteger) value
44 59
 {
45 60
    lineNumber_ = value;
... ...
@@ -1,12 +1,37 @@
1
-/*
2
- *  MulleCore - Optimized Foundation Replacements and Extensions Functionality
3
- *              also a part of MulleEOFoundation of MulleEOF (Project Titmouse)
4
- *              which is part of the Mulle EOControl Framework Collection
5
- *  Copyright (C) 2013 Nat!, Codeon GmbH, Mulle kybernetiK. All rights reserved.
6
- *
7
- *  Coded by Nat!
8
- *
9
- */
1
+//
2
+//  MulleCore - Optimized Foundation Replacements and Extensions Functionality
3
+//              also a part of MulleEOFoundation of MulleEOF (Project Titmouse)
4
+//              which is part of the Mulle EOControl Framework Collection
5
+//  Copyright (C) 2013 Nat!, Codeon GmbH, Mulle kybernetiK. All rights reserved.
6
+//
7
+//
8
+//  Redistribution and use in source and binary forms, with or without
9
+//  modification, are permitted provided that the following conditions are met:
10
+//
11
+//  Redistributions of source code must retain the above copyright notice, this
12
+//  list of conditions and the following disclaimer.
13
+//
14
+//  Redistributions in binary form must reproduce the above copyright notice,
15
+//  this list of conditions and the following disclaimer in the documentation
16
+//  and/or other materials provided with the distribution.
17
+//
18
+//  Neither the name of Mulle kybernetiK nor the names of its contributors
19
+//  may be used to endorse or promote products derived from this software
20
+//  without specific prior written permission.
21
+//
22
+//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+//  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+//  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+//  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+//  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+//  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+//  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+//  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+//  POSSIBILITY OF SUCH DAMAGE.
33
+//
34
+
10 35
 #ifndef __has_feature      // Optional.
11 36
 # define __has_feature(x) 0 // Compatibility with non-clang compilers.
12 37
 #endif
... ...
@@ -63,7 +63,7 @@
63 63
  printf( "%s", [output UTF8String]);
64 64
  * --------------snip------------------------
65 65
  */
66
-@interface MulleScionTemplate ( Convenience)
66
+@interface MulleScionTemplate( Convenience)
67 67
 
68 68
 - (id) initWithUTF8String:(unsigned char *) s;
69 69
 
... ...
@@ -117,7 +117,7 @@
117 117
 
118 118
 #ifndef DONT_HAVE_MULLE_SCION_CACHING
119 119
 
120
-@interface MulleScionTemplate ( Caching)
120
+@interface MulleScionTemplate( Caching)
121 121
 
122 122
 // Easier to use environment variable: MulleScionCacheDirectory
123 123
 + (void) setCacheDirectory:(NSString *) directory;
... ...
@@ -52,7 +52,7 @@
52 52
 char  MulleScionFrameworkVersion[] = STRINGIFY( PROJECT_VERSION);
53 53
 
54 54
 
55
-@implementation MulleScionTemplate ( Convenience)
55
+@implementation MulleScionTemplate( Convenience)
56 56
 
57 57
 + (BOOL) writeToOutput:(id <MulleScionOutput>) output
58 58
           templateFile:(NSObject <MulleScionStringOrURL> *) fileName
... ...
@@ -338,7 +338,7 @@ static MulleScionPrinter  *createPrinterWithDatasource( id dataSource)
338 338
 
339 339
 #define MulleScionCacheDirectoryKey   @"MulleScionCacheDirectory"
340 340
 
341
-@implementation MulleScionTemplate ( Caching)
341
+@implementation MulleScionTemplate( Caching)
342 342
 
343 343
 static BOOL       cacheEnabled_;
344 344
 static NSString   *cacheDirectory_;
... ...
@@ -1,5 +1,5 @@
1 1
 //
2
-//  MulleScionOutputProtocol.h
2
+//  MulleScionDataSourceProtocol.h
3 3
 //  MulleScion
4 4
 //
5 5
 //  Created by Nat! on 27.02.13.
... ...
@@ -100,7 +100,7 @@
100 100
 // 
101 101
 // NSObject has default implementations for all methods (also KVC)
102 102
 //
103
-@interface NSObject ( MulleScionDataSource) < MulleScionDataSource >
103
+@interface NSObject( MulleScionDataSource) 
104 104
 
105 105
 - (id) mulleScionDataSource;
106 106
 
... ...
@@ -1,5 +1,5 @@
1 1
 //
2
-//  NSObject+MulleScionDataSource.m
2
+//  MulleScionDataSourceProtocol.m
3 3
 //  MulleScion
4 4
 //
5 5
 //  Created by Nat! on 27.02.13.
... ...
@@ -41,7 +41,7 @@
41 41
 #import "MulleScionPrintingException.h"
42 42
 
43 43
 
44
-@interface NSObject ( OldMethods)
44
+@interface NSObject( OldMethods)
45 45
 
46 46
 + (void) poseAs:(Class) cls;
47 47
 
... ...
@@ -54,7 +54,7 @@
54 54
 // Your dataSource can override this method and check if the keyPath is OK.
55 55
 // If not, raise an exception otherwise call super.
56 56
 //
57
-@implementation NSObject ( MulleScionDataSource)
57
+@implementation NSObject( MulleScionDataSourceSupport)
58 58
 
59 59
 - (id) mulleScionValueForKeyPath:(NSString *) keyPath
60 60
                   localVariables:(NSMutableDictionary *) locals
... ...
@@ -43,6 +43,7 @@
43 43
 id   MulleScionNull;
44 44
 id   MulleScionZero;
45 45
 
46
+
46 47
 + (void) load
47 48
 {
48 49
    MulleScionNull = self;
... ...
@@ -38,7 +38,7 @@
38 38
 #import "MulleScionObjectModel+Parsing.h"
39 39
 
40 40
 
41
-@interface MulleScionObject ( BlockExpansion)
41
+@interface MulleScionObject( BlockExpansion)
42 42
 
43 43
 - (MulleScionObject *) ownerOfBlockWithIdentifier:(NSString *) identifier;
44 44
 - (MulleScionObject *) nextOwnerOfBlockCommand;
... ...
@@ -39,7 +39,7 @@
39 39
 #import "MulleScionObjectModel+NSCoding.h"
40 40
 
41 41
 
42
-@implementation MulleScionObject ( BlockExpansion)
42
+@implementation MulleScionObject( BlockExpansion)
43 43
 
44 44
 - (MulleScionObject *) nextOwnerOfBlockCommand
45 45
 {
... ...
@@ -8,7 +8,7 @@
8 8
 #import "MulleScionObjectModel.h"
9 9
 
10 10
 
11
-@interface NSObject ( MulleGraphvizSubclassing)
11
+@interface NSObject( MulleGraphvizSubclassing)
12 12
 
13 13
 - (NSMutableDictionary *) mulleGraphvizAttributes;
14 14
 - (NSMutableDictionary *) mulleGraphvizChildrenByName;
... ...
@@ -22,7 +22,7 @@
22 22
 
23 23
 
24 24
 // a beginning, not the end
25
-@implementation MulleScionObject ( MulleGraphviz)
25
+@implementation MulleScionObject( MulleGraphviz)
26 26
 
27 27
 - (NSMutableDictionary *) mulleGraphvizChildrenByName
28 28
 {
... ...
@@ -56,7 +56,7 @@
56 56
 
57 57
 
58 58
 
59
-@implementation MulleScionValueObject ( MulleGraphviz)
59
+@implementation MulleScionValueObject( MulleGraphviz)
60 60
 
61 61
 - (NSMutableDictionary *) mulleGraphvizAttributes
62 62
 {
... ...
@@ -71,7 +71,7 @@
71 71
 @end
72 72
 
73 73
 
74
-@implementation MulleScionBinaryOperatorExpression ( Graphviz)
74
+@implementation MulleScionBinaryOperatorExpression( Graphviz)
75 75
 
76 76
 - (NSMutableDictionary *) mulleGraphvizAttributes
77 77
 {
... ...
@@ -95,7 +95,7 @@
95 95
 @end
96 96
 
97 97
 
98
-@implementation MulleScionComparison ( MulleGraphviz)
98
+@implementation MulleScionComparison( MulleGraphviz)
99 99
 
100 100
 - (NSMutableDictionary *) mulleGraphvizAttributes
101 101
 {
... ...
@@ -37,7 +37,7 @@
37 37
 #import "MulleScionObjectModel+Parsing.h"
38 38
 
39 39
 
40
-@interface MulleScionMacro ( MacroExpansion)
40
+@interface MulleScionMacro( MacroExpansion)
41 41
 
42 42
 - (NSDictionary *) parametersWithArguments:(NSArray *) arguments
43 43
                                   fileName:(NSString *) fileName
... ...
@@ -49,7 +49,7 @@
49 49
 @end
50 50
 
51 51
 
52
-@interface MulleScionObject ( VariableSubstitution)
52
+@interface MulleScionObject( VariableSubstitution)
53 53
 
54 54
 //
55 55
 // will return nil, if the object itself needs not to be exchanged
... ...
@@ -42,7 +42,7 @@
42 42
 // this is totally hackish
43 43
 
44 44
 
45
-@implementation MulleScionObject ( VariableSubstitution)
45
+@implementation MulleScionObject( VariableSubstitution)
46 46
 
47 47
 - (id) replaceVariableWithIdentifier:(NSString *)identifier
48 48
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -53,7 +53,7 @@
53 53
 @end
54 54
 
55 55
 
56
-@implementation MulleScionIdentifierExpression ( VariableSubstitution)
56
+@implementation MulleScionIdentifierExpression( VariableSubstitution)
57 57
 
58 58
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
59 59
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -153,7 +153,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
153 153
 }
154 154
 
155 155
 
156
-@implementation MulleScionArray ( VariableSubstitution)
156
+@implementation MulleScionArray( VariableSubstitution)
157 157
 
158 158
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
159 159
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -174,7 +174,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
174 174
 
175 175
 
176 176
 
177
-@implementation MulleScionDictionary ( VariableSubstitution)
177
+@implementation MulleScionDictionary( VariableSubstitution)
178 178
    
179 179
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
180 180
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -194,7 +194,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
194 194
 @end
195 195
 
196 196
 
197
-@implementation MulleScionFunction ( VariableSubstitution)
197
+@implementation MulleScionFunction( VariableSubstitution)
198 198
 
199 199
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
200 200
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -215,7 +215,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
215 215
 @end
216 216
 
217 217
 
218
-@implementation MulleScionMethod ( VariableSubstitution)
218
+@implementation MulleScionMethod( VariableSubstitution)
219 219
 
220 220
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
221 221
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -250,7 +250,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
250 250
 
251 251
 
252 252
 
253
-@implementation MulleScionUnaryOperatorExpression ( VariableSubstitution)
253
+@implementation MulleScionUnaryOperatorExpression( VariableSubstitution)
254 254
 
255 255
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
256 256
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -272,7 +272,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
272 272
 @end
273 273
 
274 274
 
275
-@implementation MulleScionBinaryOperatorExpression ( VariableSubstitution)
275
+@implementation MulleScionBinaryOperatorExpression( VariableSubstitution)
276 276
 
277 277
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
278 278
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -307,7 +307,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
307 307
 //
308 308
 // can't fully macro expand right side of a pipe
309 309
 //
310
-@implementation MulleScionPipe ( Printing)
310
+@implementation MulleScionPipe( VariableSubstitution)
311 311
 
312 312
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
313 313
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -340,7 +340,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
340 340
 @end
341 341
 
342 342
 
343
-@implementation MulleScionDot ( Printing)
343
+@implementation MulleScionDot( VariableSubstitution)
344 344
 
345 345
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
346 346
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -372,7 +372,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
372 372
 @end
373 373
 
374 374
 
375
-@implementation MulleScionConditional ( VariableSubstitution)
375
+@implementation MulleScionConditional( VariableSubstitution)
376 376
 
377 377
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
378 378
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -409,7 +409,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
409 409
 @end
410 410
 
411 411
 
412
-@implementation MulleScionAssignmentExpression ( VariableSubstitution)
412
+@implementation MulleScionAssignmentExpression( VariableSubstitution)
413 413
 
414 414
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
415 415
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -439,7 +439,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
439 439
 @end
440 440
 
441 441
 
442
-@implementation MulleScionSet ( VariableSubstitution)
442
+@implementation MulleScionSet( VariableSubstitution)
443 443
 
444 444
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
445 445
                      withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -469,7 +469,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
469 469
 @end
470 470
 
471 471
 
472
-@implementation MulleScionExpressionCommand ( VariableSubstitution)
472
+@implementation MulleScionExpressionCommand( VariableSubstitution)
473 473
 
474 474
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
475 475
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -494,7 +494,7 @@ static NSMutableArray  *replaceVariablesWithIdentifierInArray( NSArray *array,
494 494
 # pragma mark -
495 495
 # pragma Expansion Works
496 496
 
497
-@implementation MulleScionMacro ( MacroExpansion)
497
+@implementation MulleScionMacro( MacroExpansion)
498 498
 
499 499
 - (id) replaceVariableWithIdentifier:(NSString *) identifier
500 500
                       withExpression:(MulleScionExpression *) expr NS_RETURNS_RETAINED
... ...
@@ -605,12 +605,14 @@ typedef struct
605 605
    id                              value;
606 606
    NSString                        *identifier;
607 607
    NSMutableArray                  *identifiers;
608
+   NSArray                         *arguments;
608 609
    
609 610
    parameters  = [NSMutableDictionary dictionary];
610 611
    identifiers = [NSMutableArray array];
611 612
    
612 613
    // first setup default values for macro and remember where what is
613
-   rover = [[[self function] arguments] objectEnumerator];
614
+   arguments = [[self function] arguments];
615
+   rover     = [arguments objectEnumerator];
614 616
    
615 617
    while( expr = [rover nextObject])
616 618
    {
... ...
@@ -37,7 +37,7 @@
37 37
 #import "MulleScionObjectModel+MulleMongoose.h"
38 38
 
39 39
 
40
-@implementation MulleScionTemplate ( MulleMongoose)
40
+@implementation MulleScionTemplate( MulleMongoose)
41 41
 
42 42
 static BOOL fileExists( NSString *fileName)
43 43
 {
... ...
@@ -37,7 +37,7 @@
37 37
 #import "MulleScionObjectModel.h"
38 38
 
39 39
 
40
-@interface MulleScionObject ( NSCoding) < NSCoding, NSCopying >
40
+@interface MulleScionObject( NSCoding) < NSCoding, NSCopying >
41 41
 
42 42
 - (id) initWithCoder:(NSCoder *) decoder;
43 43
 - (void) encodeWithCoder:(NSCoder *) encoder;
... ...
@@ -38,7 +38,7 @@
38 38
 #import "MulleScionObjectModel+NSCoding.h"
39 39
 
40 40
 
41
-@implementation MulleScionObject ( NSCoding)
41
+@implementation MulleScionObject( NSCoding)
42 42
 
43 43
 + (void) load
44 44
 {
... ...
@@ -50,12 +50,12 @@
50 50
 // use NSCoding to make a copy, so I don't have to write all those
51 51
 // copy routines
52 52
 //
53
-- (id) copyWithZone:(NSZone *) zone
53
+static id  _copy(id self)
54 54
 {
55 55
    NSData             *data;
56 56
    NSAutoreleasePool  *pool;
57 57
    id                 copy;
58
-   
58
+
59 59
    pool = [NSAutoreleasePool new];
60 60
 #if TARGET_OS_IPHONE  // much slower...
61 61
    data = [NSKeyedArchiver archivedDataWithRootObject:self];
... ...
@@ -65,23 +65,35 @@
65 65
    copy = [[NSUnarchiver unarchiveObjectWithData:data] retain];
66 66
 #endif
67 67
    [pool release];
68
-   
68
+
69 69
    return( copy);
70 70
 }
71
-    
72
-    
71
+
72
+
73
+- (id) copyWithZone:(NSZone *) zone
74
+{
75
+   return( _copy( self));
76
+}
77
+
78
+
79
+- (id) copy
80
+{
81
+   return( _copy( self));
82
+}
83
+
84
+
73 85
 - (id) initWithCoder:(NSCoder *) decoder
74 86
 {
75 87
    uint32_t  lineNumber;
76 88
    id        next;
77
-   
89
+
78 90
    [decoder decodeValueOfObjCType:@encode( uint32_t)
79 91
                                at:&lineNumber];
80 92
 
81 93
     // needed to be coded like this otherwise keyed unarchiver trashes the
82 94
     // stack
83 95
    next = [decoder decodeObject];
84
-   
96
+
85 97
    self = [self initWithLineNumber:lineNumber];
86 98
    assert( self);
87 99
 
... ...
@@ -93,7 +105,7 @@
93 93
 - (void) encodeWithCoder:(NSCoder *) encoder
94 94
 {
95 95
    uint32_t  lineNumber;
96
-   
96
+
97 97
    lineNumber = (uint32_t) lineNumber_;
98 98
    [encoder encodeValueOfObjCType:@encode( uint32_t)
99 99
                                at:&lineNumber];
... ...
@@ -103,13 +115,13 @@
103 103
 @end
104 104
 
105 105
 
106
-@implementation MulleScionValueObject ( NSCoding)
106
+@implementation MulleScionValueObject( NSCoding)
107 107
 
108 108
 - (id) initWithCoder:(NSCoder *) decoder
109 109
 {
110 110
    self = [super initWithCoder:decoder];
111 111
    assert( self);
112
-   
112
+
113 113
    [decoder decodeValuesOfObjCTypes:"@", &value_];
114 114
    return( self);
115 115
 }
... ...
@@ -124,13 +136,13 @@
124 124
 @end
125 125
 
126 126
 
127
-@implementation MulleScionAssignmentExpression ( NSCoding )
127
+@implementation MulleScionAssignmentExpression( NSCoding )
128 128
 
129 129
 - (id) initWithCoder:(NSCoder *) decoder
130 130
 {
131 131
    self = [super initWithCoder:decoder];
132 132
    assert( self);
133
-   
133
+
134 134
    [decoder decodeValuesOfObjCTypes:"@", &right_];
135 135
    return( self);
136 136
 }
... ...
@@ -145,13 +157,13 @@
145 145
 @end
146 146
 
147 147
 
148
-@implementation MulleScionParameterAssignment ( NSCoding )
148
+@implementation MulleScionParameterAssignment( NSCoding )
149 149
 
150 150
 - (id) initWithCoder:(NSCoder *) decoder
151 151
 {
152 152
    self = [super initWithCoder:decoder];
153 153
    assert( self);
154
-   
154
+
155 155
    [decoder decodeValuesOfObjCTypes:"@", &expression_];
156 156
    return( self);
157 157
 }
... ...
@@ -166,13 +178,13 @@
166 166
 @end
167 167
 
168 168
 
169
-@implementation MulleScionFunction ( NSCoding )
169
+@implementation MulleScionFunction( NSCoding )
170 170
 
171 171
 - (id) initWithCoder:(NSCoder *) decoder
172 172
 {
173 173
    self = [super initWithCoder:decoder];
174 174
    assert( self);
175
-   
175
+
176 176
    [decoder decodeValuesOfObjCTypes:"@", &arguments_];
177 177
    return( self);
178 178
 }
... ...
@@ -187,15 +199,15 @@
187 187
 @end
188 188
 
189 189
 
190
-@implementation MulleScionMethod ( NSCoding )
190
+@implementation MulleScionMethod( NSCoding )
191 191
 
192 192
 - (id) initWithCoder:(NSCoder *) decoder
193 193
 {
194 194
    NSString  *methodName;
195
-   
195
+
196 196
    self = [super initWithCoder:decoder];
197 197
    assert( self);
198
-   
198
+
199 199
    [decoder decodeValuesOfObjCTypes:"@@", &arguments_, &methodName];
200 200
    action_ = NSSelectorFromString( methodName);
201 201
    [methodName release];
... ...
@@ -215,13 +227,13 @@
215 215
 @end
216 216
 
217 217
 
218
-@implementation MulleScionBinaryOperatorExpression  ( NSCoding )
218
+@implementation MulleScionBinaryOperatorExpression ( NSCoding )
219 219
 
220 220
 - (id) initWithCoder:(NSCoder *) decoder
221 221
 {
222 222
    self = [super initWithCoder:decoder];
223 223
    assert( self);
224
-   
224
+
225 225
    [decoder decodeValuesOfObjCTypes:"@", &right_];
226 226
    return( self);
227 227
 }
... ...
@@ -236,7 +248,7 @@
236 236
 @end
237 237
 
238 238
 
239
-@implementation MulleScionComparison  ( NSCoding )
239
+@implementation MulleScionComparison ( NSCoding )
240 240
 
241 241
 - (id) initWithCoder:(NSCoder *) decoder
242 242
 {
... ...
@@ -244,7 +256,7 @@
244 244
 
245 245
    self = [super initWithCoder:decoder];
246 246
    assert( self);
247
-   
247
+
248 248
    [decoder decodeValuesOfObjCTypes:"C", &code];
249 249
    comparison_ = code;
250 250
    return( self);
... ...
@@ -254,7 +266,7 @@
254 254
 - (void) encodeWithCoder:(NSCoder *) encoder
255 255
 {
256 256
    unsigned char   code;
257
-   
257
+
258 258
    [super encodeWithCoder:encoder];
259 259
    code = comparison_;
260 260
    [encoder encodeValuesOfObjCTypes:"C", &code];
... ...
@@ -263,13 +275,13 @@
263 263
 @end
264 264
 
265 265
 
266
-@implementation MulleScionConditional ( NSCoding )
266
+@implementation MulleScionConditional( NSCoding )
267 267
 
268 268
 - (id) initWithCoder:(NSCoder *) decoder
269 269
 {
270 270
    self = [super initWithCoder:decoder];
271 271
    assert( self);
272
-   
272
+
273 273
    [decoder decodeValuesOfObjCTypes:"@@", &middle_, &right_];
274 274
    return( self);
275 275
 }
... ...
@@ -284,13 +296,13 @@
284 284
 @end
285 285
 
286 286
 
287
-@implementation MulleScionExpressionCommand ( NSCoding)
287
+@implementation MulleScionExpressionCommand( NSCoding)
288 288
 
289 289
 - (id) initWithCoder:(NSCoder *) decoder
290 290
 {
291 291
    self = [super initWithCoder:decoder];
292 292
    assert( self);
293
-   
293
+
294 294
    [decoder decodeValuesOfObjCTypes:"@", &expression_];
295 295
    return( self);
296 296
 }
... ...
@@ -305,7 +317,7 @@
305 305
 @end
306 306
 
307 307
 
308
-@implementation MulleScionFilter ( NSCoding)
308
+@implementation MulleScionFilter( NSCoding)
309 309
 
310 310
 - (id) initWithCoder:(NSCoder *) decoder
311 311
 {
... ...
@@ -326,13 +338,13 @@
326 326
 
327 327
 
328 328
 
329
-@implementation MulleScionSet ( NSCoding)
329
+@implementation MulleScionSet( NSCoding)
330 330
 
331 331
 - (id) initWithCoder:(NSCoder *) decoder
332 332
 {
333 333
    self = [super initWithCoder:decoder];
334 334
    assert( self);
335
-   
335
+
336 336
    [decoder decodeValuesOfObjCTypes:"@@", &left_, &right_];
337 337
    return( self);
338 338
 }
... ...
@@ -348,13 +360,13 @@
348 348
 
349 349
 
350 350
 
351
-@implementation MulleScionBlock ( NSCoding)
351
+@implementation MulleScionBlock( NSCoding)
352 352
 
353 353
 - (id) initWithCoder:(NSCoder *) decoder
354 354
 {
355 355
    self = [super initWithCoder:decoder];
356 356
    assert( self);
357
-   
357
+
358 358
    [decoder decodeValuesOfObjCTypes:"@@", &identifier_, &fileName_];
359 359
    return( self);
360 360
 }
... ...
@@ -370,7 +382,7 @@
370 370
 
371 371
 
372 372
 #ifdef DEBUG
373
-@implementation MulleScionMacro ( NSCoding )
373
+@implementation MulleScionMacro( NSCoding )
374 374
 
375 375
 - (id) initWithCoder:(NSCoder *) decoder
376 376
 {
... ...
@@ -386,13 +398,13 @@
386 386
 #endif
387 387
 
388 388
 
389
-@implementation MulleScionRequires ( NSCoding)
389
+@implementation MulleScionRequires( NSCoding)
390 390
 
391 391
 - (id) initWithCoder:(NSCoder *) decoder
392 392
 {
393 393
    self = [super initWithCoder:decoder];
394 394
    assert( self);
395
-   
395
+
396 396
    [decoder decodeValuesOfObjCTypes:"@", &identifier_];
397 397
    return( self);
398 398
 }
... ...
@@ -40,7 +40,7 @@
40 40
 #import "MulleScionOutputProtocol.h"
41 41
 
42 42
 
43
-@interface MulleScionObject ( Printing)
43
+@interface MulleScionObject( Printing)
44 44
 
45 45
 - (MulleScionObject *) renderInto:(id <MulleScionOutput>) output
46 46
                    localVariables:(NSMutableDictionary *) locals
... ...
@@ -66,7 +66,7 @@ extern NSString   *MulleScionEvenKey;
66 66
 extern NSString   *MulleScionOddKey;
67 67
 
68 68
 
69
-@interface MulleScionTemplate ( Printing)
69
+@interface MulleScionTemplate( Printing)
70 70
 
71 71
 - (NSMutableDictionary *) localVariablesWithDefaultValues:(NSDictionary *) defaults;
72 72
 + (NSMutableDictionary *) mulleScionDefaultBuiltinFunctionTable;
... ...
@@ -45,7 +45,7 @@
45 45
 #import "MulleCommonObjCRuntime.h"
46 46
 #if ! TARGET_OS_IPHONE
47 47
 # import <Foundation/NSDebug.h>
48
-# ifndef __MULLE_OBJC_RUNTIME__
48
+# ifndef __MULLE_OBJC__
49 49
 #  import <objc/objc-class.h>
50 50
 # endif
51 51
 #else
... ...
@@ -110,7 +110,7 @@ static BOOL   isTracing;
110 110
 static void   _TRACE_EVAL_BEGIN( MulleScionObject *self, id value)
111 111
 {
112 112
    NSString   *s;
113
-   
113
+
114 114
    s = [NSString stringWithFormat:@"%ld: -->%@ :: %@",
115 115
         (long) [self lineNumber],
116 116
         [self traceDescription],
... ...
@@ -123,8 +123,8 @@ static void   _TRACE_EVAL_BEGIN( MulleScionObject *self, id value)
123 123
 static inline void   _TRACE_EVAL_END( MulleScionObject *self, id value)
124 124
 {
125 125
    NSString   *s;
126
-   
127
-   
126
+
127
+
128 128
    s = [NSString stringWithFormat:@"%ld: <--%@ :: %@",
129 129
                 (long) [self lineNumber],
130 130
                 [self traceDescription],
... ...
@@ -136,10 +136,10 @@ static inline void   _TRACE_EVAL_END( MulleScionObject *self, id value)
136 136
 static inline void   _TRACE_EVAL_CONT( MulleScionObject *self, id value)
137 137
 {
138 138
    NSString   *s;
139
-   
139
+
140 140
    if( ! isTracing)
141 141
       return;
142
-   
142
+
143 143
    s = [NSString stringWithFormat:@"%ld:    %@ :: %@",
144 144
         (long) [self lineNumber],
145 145
         [self traceDescription],
... ...
@@ -152,7 +152,7 @@ static inline void   _TRACE_EVAL_CONT( MulleScionObject *self, id value)
152 152
 static inline void   _TRACE_EVAL_BEGIN_END( MulleScionObject *self, id value, id result)
153 153
 {
154 154
    NSString   *s;
155
-   
155
+
156 156
    s = [NSString stringWithFormat:@"%ld: <->%@ :: %@->%@",
157 157
         (long) [self lineNumber],
158 158
         [self traceDescription],
... ...
@@ -199,7 +199,7 @@ static inline void   TRACE_EVAL_BEGIN_END( MulleScionObject *self, id value, id
199 199
 # define TRACE_EVAL_BEGIN_END( self, value, result)
200 200
 #endif
201 201
 
202
-@interface MulleScionExpression ( Printing)
202
+@interface MulleScionExpression( Printing)
203 203
 
204 204
 // this should never return nil, but MulleScionNull instead
205 205
 // should also never receive nil as value
... ...
@@ -216,7 +216,7 @@ static inline void   TRACE_EVAL_BEGIN_END( MulleScionObject *self, id value, id
216 216
 
217 217
 #pragma mark -
218 218
 
219
-@implementation MulleScionObject ( Printing)
219
+@implementation MulleScionObject( Printing)
220 220
 
221 221
 - (MulleScionObject *) renderInto:(id <MulleScionOutput>) output
222 222
                    localVariables:(NSMutableDictionary *) locals
... ...
@@ -231,10 +231,10 @@ static void   pushFileName( NSMutableDictionary *locals, NSString *filename)
231 231
 {
232 232
    NSMutableArray   *stack;
233 233
    NSString         *prev;
234
-   
234
+
235 235
    prev = [locals objectForKey:MulleScionCurrentFileKey];
236 236
    NSCParameterAssert( prev);
237
-   
237
+
238 238
    stack = [locals objectForKey:MulleScionPreviousFilesKey];
239 239
    if( ! stack)
240 240
    {
... ...
@@ -254,9 +254,9 @@ static void   popFileName( NSMutableDictionary *locals)
254 254
 {
255 255
    NSString         *prev;
256 256
    NSMutableArray   *stack;
257
-   
257
+
258 258
    NSCParameterAssert( [locals objectForKey:MulleScionPreviousFilesKey] != nil);
259
-   
259
+
260 260
    stack = [locals objectForKey:MulleScionPreviousFilesKey];
261 261
    NSCParameterAssert( stack);
262 262
    prev = [stack lastObject];
... ...
@@ -276,13 +276,13 @@ NSString  *MulleScionFilteredString( NSString *value,
276 276
    NSEnumerator   *rover;
277 277
    NSEnumerator   *modeRover;
278 278
    NSUInteger     mask;
279
-   
279
+
280 280
    NSCParameterAssert( ! value || [value isKindOfClass:[NSString class]]);
281
-   
281
+
282 282
    filter = [locals objectForKey:MulleScionCurrentFilterKey];
283 283
    if( ! filter)
284 284
       return( value);
285
-   
285
+
286 286
    // if turned off, don't filter
287 287
    mask = [[locals objectForKey:MulleScionCurrentFilterModeKey] integerValue];
288 288
    if( mask & bit)
... ...
@@ -293,10 +293,10 @@ NSString  *MulleScionFilteredString( NSString *value,
293 293
       NSCParameterAssert( filtered);
294 294
       if( filtered == MulleScionNull)
295 295
          return( nil);
296
-      
296
+
297 297
       value = filtered;
298 298
    }
299
-   
299
+
300 300
    //
301 301
    // if FilterApplyStackedFilters we execute all nested filters
302 302
    // too, this is less suprising but also less compatible to how it was before
... ...
@@ -313,7 +313,7 @@ NSString  *MulleScionFilteredString( NSString *value,
313 313
             filtered = [filter evaluateValue:value
314 314
                               localVariables:locals
315 315
                                   dataSource:dataSource];
316
-            
316
+
317 317
             NSCParameterAssert( filtered);
318 318
             if( filtered == MulleScionNull)
319 319
                return( nil);
... ...
@@ -322,7 +322,7 @@ NSString  *MulleScionFilteredString( NSString *value,
322 322
          }
323 323
       }
324 324
    }
325
-   
325
+
326 326
    return( value);
327 327
 }
328 328
 
... ...
@@ -349,11 +349,11 @@ void   MulleScionRenderPlaintextString( NSString *value,
349 349
                                         id <MulleScionDataSource> dataSource)
350 350
 {
351 351
    NSString   *s;
352
-   
352
+
353 353
    s = MulleScionFilteredString( value, locals, dataSource, FilterPlaintext|FilterApplyStackedFilters);
354 354
    if( ! s)
355 355
       return;
356
-   
356
+
357 357
    NSCParameterAssert( [s isKindOfClass:[NSString class]]);
358 358
    [output appendString:s];
359 359
 }
... ...
@@ -363,12 +363,12 @@ void   MulleScionRenderPlaintextString( NSString *value,
363 363
 
364 364
 #pragma mark -
365 365
 
366
-@implementation MulleScionTemplate ( Printing)
366
+@implementation MulleScionTemplate( Printing)
367 367
 
368 368
 static void   initLineNumber( NSMutableDictionary *locals)
369 369
 {
370 370
    MulleMutableLineNumber   *nr;
371
-   
371
+
372 372
    nr = [MulleMutableLineNumber new];
373 373
    [locals setObject:nr
374 374
               forKey:MulleScionCurrentLineKey];
... ...
@@ -379,7 +379,7 @@ static void   initLineNumber( NSMutableDictionary *locals)
379 379
 static void   updateLineNumber( MulleScionObject *self, NSMutableDictionary *locals)
380 380
 {
381 381
    MulleMutableLineNumber   *nr;
382
-   
382
+
383 383
    // linenumber is trusted and not funneled
384 384
    nr = [locals objectForKey:MulleScionCurrentLineKey];
385 385
    [nr setUnsignedInteger:self->lineNumber_];
... ...
@@ -392,7 +392,7 @@ static id  f_filter( id self, NSArray *arguments, NSMutableDictionary *locals)
392 392
 {
393 393
    NSString   *string;
394 394
    id         value;
395
-   
395
+
396 396
    MulleScionPrintingValidateArgumentCount( arguments, 1, locals);
397 397
    value  = MulleScionPrintingValidatedArgument( arguments, 0, Nil, locals);
398 398
    string = [value mulleScionDescriptionWithLocalVariables:locals];
... ...
@@ -405,7 +405,7 @@ static id  f_defined( id self, NSArray *arguments, NSMutableDictionary *locals)
405 405
 {
406 406
    id     value;
407 407
    BOOL   flag;
408
-   
408
+
409 409
    MulleScionPrintingValidateArgumentCount( arguments, 1, locals);
410 410
    value = MulleScionPrintingValidatedArgument( arguments, 0, [NSString class], locals);
411 411
    flag  = [self mulleScionValueForKeyPath:value
... ...
@@ -419,11 +419,11 @@ static id  f_defined( id self, NSArray *arguments, NSMutableDictionary *locals)
419 419
 static id  f_NSMakeRange( id self, NSArray *arguments, NSMutableDictionary *locals)
420 420
 {
421 421
    NSRange   range;
422
-   
422
+
423 423
    MulleScionPrintingValidateArgumentCount( arguments, 2, locals);
424 424
    range.location = [MulleScionPrintingValidatedArgument( arguments, 0, [NSNumber class], locals) unsignedIntegerValue];
425 425
    range.length   = [MulleScionPrintingValidatedArgument( arguments, 1, [NSNumber class], locals) unsignedIntegerValue];
426
-   
426
+
427 427
    return( [NSValue valueWithRange:range]);
428 428
 }
429 429
 
... ...
@@ -431,7 +431,7 @@ static id  f_NSMakeRange( id self, NSArray *arguments, NSMutableDictionary *loca
431 431
 static id  f_NSStringFromRange( id self, NSArray *arguments, NSMutableDictionary *locals)
432 432
 {
433 433
    NSRange   range;
434
-   
434
+
435 435
    MulleScionPrintingValidateArgumentCount( arguments, 1, locals);
436 436
    range = [MulleScionPrintingValidatedArgument( arguments, 0, [NSValue class], locals) rangeValue];
437 437
    return( NSStringFromRange( range));
... ...
@@ -443,7 +443,7 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
443 443
    NSString   *s1;
444 444
 
445 445
    MulleScionPrintingValidateArgumentCount( arguments, 2, locals);
446
-   
446
+
447 447
    s1 = MulleScionPrintingValidatedArgument( arguments, 0, [NSString class], locals);
448 448
 
449 449
    return( NSLocalizedString( s1, nil));
... ...
@@ -453,7 +453,7 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
453 453
 + (NSMutableDictionary *) mulleScionDefaultBuiltinFunctionTable
454 454
 {
455 455
    NSMutableDictionary  *dictionary;
456
-   
456
+
457 457
    dictionary = [NSMutableDictionary dictionary];
458 458
    [dictionary setObject:[NSValue valueWithPointer:f_NSStringFromRange]
459 459
                   forKey:@"NSStringFromRange"];
... ...
@@ -478,7 +478,7 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
478 478
               forKey:@"NSOrderedAscending"];
479 479
    [locals setObject:[NSNumber numberWithUnsignedLong:NSOrderedDescending]
480 480
               forKey:@"NSOrderedDescending"];
481
-   
481
+
482 482
    [locals setObject:[NSNumber numberWithUnsignedLong:NSASCIIStringEncoding]
483 483
               forKey:@"NSASCIIStringEncoding"];
484 484
    [locals setObject:[NSNumber numberWithUnsignedLong:NSISOLatin1StringEncoding]
... ...
@@ -491,7 +491,7 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
491 491
               forKey:@"NSUTF8StringEncoding"];
492 492
    [locals setObject:[NSNumber numberWithUnsignedLong:NSUTF32StringEncoding]
493 493
               forKey:@"NSUTF32StringEncoding"];
494
-   
494
+
495 495
    [locals setObject:[NSNumber numberWithUnsignedLong:NSNotFound]
496 496
               forKey:@"NSNotFound"];
497 497
 }
... ...
@@ -500,7 +500,7 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
500 500
 - (NSMutableDictionary *) localVariablesWithDefaultValues:(NSDictionary *) defaults
501 501
 {
502 502
    NSMutableDictionary   *locals;
503
-   
503
+
504 504
    locals = [NSMutableDictionary dictionary];
505 505
 
506 506
    // built in first
... ...
@@ -515,7 +515,7 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
515 515
    if( ! [locals objectForKey:MulleScionFunctionTableKey])
516 516
       [locals setObject:[MulleGetClass( self) mulleScionDefaultBuiltinFunctionTable]
517 517
                  forKey:MulleScionFunctionTableKey];
518
-   
518
+
519 519
 #if defined( HAVE_TRACE)
520 520
    isTracing = getenv( "MulleScionTrace") != NULL;
521 521
    [locals setObject:[NSNumber numberWithBool:isTracing]
... ...
@@ -531,13 +531,13 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
531 531
 {
532 532
    MulleScionObject   *curr;
533 533
    NSAutoreleasePool  *pool;
534
-   
534
+
535 535
    NSAssert( [locals valueForKey:@"NSNotFound"], @"use -[MulleScionTemplate localVariablesWithDefaultValues:] to create the localVariables dictionary");
536 536
 
537 537
    TRACE_RENDER( self, s, locals, dataSource);
538 538
 
539 539
    pool = [NSAutoreleasePool new];
540
-   
540
+
541 541
    //
542 542
    // expose everything to the dataSource for max. hackability
543 543
    // trusted (writing OK, reading ? your choice!)
... ...
@@ -548,7 +548,7 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
548 548
               forKey:MulleScionRenderOutputKey];
549 549
    [locals setObject:value_
550 550
               forKey:MulleScionCurrentFileKey];
551
-#if __MULLE_OBJC_RUNTIME__
551
+#if __MULLE_OBJC__
552 552
    [locals setObject:@"Mulle"
553 553
              forKey:MulleScionFoundationKey];
554 554
 #else
... ...
@@ -559,15 +559,15 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
559 559
               forKey:MulleScionVersionKey];
560 560
 
561 561
    // must be provided, because it's too painful to always set it here
562
-   
562
+
563 563
    curr = self->next_;
564 564
    while( curr)
565 565
       curr = [curr renderInto:output
566 566
                localVariables:locals
567 567
                    dataSource:dataSource];
568
-   
568
+
569 569
    [pool release];
570
-   
570
+
571 571
    return( curr);
572 572
 }
573 573
 
... ...
@@ -576,7 +576,7 @@ static id  f_NSLocalizedString( id self, NSArray *arguments, NSMutableDictionary
576 576
 
577 577
 #pragma mark -
578 578
 
579
-@implementation MulleScionPlainText ( Printing)
579
+@implementation MulleScionPlainText( Printing)
580 580
 
581 581
 - (MulleScionObject *) renderInto:(id <MulleScionOutput>) output
582 582
                    localVariables:(NSMutableDictionary *) locals
... ...
@@ -597,17 +597,17 @@ static id   MulleScionValueForKeyPath( NSString *keyPath,
597 597
                                        id dataSource)
598 598
 {
599 599
    id   value;
600
- 
600
+
601 601
    if( [keyPath isEqualToString:@"self"])
602 602
    {
603 603
       id   replacement;
604
-      
604
+
605 605
       replacement = [locals objectForKey:MulleScionSelfReplacementKey];
606 606
       if( replacement)
607 607
          return( replacement);
608 608
       return( dataSource);
609 609
    }
610
-   
610
+
611 611
    value = [dataSource mulleScionValueForKeyPath:keyPath
612 612
                                 inLocalVariables:locals];
613 613
    if( ! value)
... ...
@@ -615,14 +615,14 @@ static id   MulleScionValueForKeyPath( NSString *keyPath,
615 615
                                      localVariables:locals];
616 616
    if( ! value)
617 617
       value = MulleScionNull;
618
-   
618
+
619 619
    return( value);
620 620
 }
621 621
 
622 622
 
623 623
 #pragma mark -
624 624
 
625
-@implementation MulleScionVariable ( Printing)
625
+@implementation MulleScionVariable( Printing)
626 626
 
627 627
 - (id) valueWithLocalVariables:(NSMutableDictionary *) locals
628 628
                     dataSource:(id <MulleScionDataSource>) dataSource
... ...
@@ -630,7 +630,7 @@ static id   MulleScionValueForKeyPath( NSString *keyPath,
630 630
    return( MulleScionValueForKeyPath( value_, locals, dataSource));
631 631
 }
632 632
 
633
-   
633
+
634 634
 - (void) evaluateSetValue:(id) valueToSet
635 635
        withLocalVariables:(NSMutableDictionary *) locals
636 636
                dataSource:(id <MulleScionDataSource>) dataSource
... ...
@@ -655,7 +655,7 @@ static id   MulleScionValueForKeyPath( NSString *keyPath,
655 655
           dataSource:(id <MulleScionDataSource>) dataSource
656 656
 {
657 657
    id   result;
658
-   
658
+
659 659
    result = [dataSource mulleScionPipeString:target
660 660
                                throughMethod:value_ // idenetifier
661 661
                               localVariables:locals];
... ...
@@ -667,7 +667,7 @@ static id   MulleScionValueForKeyPath( NSString *keyPath,
667 667
 
668 668
 #pragma mark -
669 669
 
670
-@implementation MulleScionFunction ( Printing)
670
+@implementation MulleScionFunction( Printing)
671 671
 
672 672
 - (id) valueWithLocalVariables:(NSMutableDictionary *) locals
673 673
                     dataSource:(id <MulleScionDataSource>) dataSource
... ...
@@ -677,7 +677,7 @@ static id   MulleScionValueForKeyPath( NSString *keyPath,
677 677
    MulleScionExpression   *expr;
678 678
    id                     argument;
679 679
    id                     result;
680
-   
680
+
681 681
    array = [NSMutableArray array];
682 682
    rover = [arguments_ objectEnumerator];
683 683
    while( expr = [rover nextObject])
... ...
@@ -686,7 +686,7 @@ static id   MulleScionValueForKeyPath( NSString *keyPath,
686 686
                                     dataSource:dataSource];
687 687
       [array addObject:argument];
688 688
    }
689
-   
689
+
690 690
    result = [dataSource mulleScionFunction:value_
691 691
                                  arguments:array
692 692
                            localVariables:locals];
... ...
@@ -700,14 +700,14 @@ static id   MulleScionValueForKeyPath( NSString *keyPath,
700 700
 
701 701
 #pragma mark -
702 702
 
703
-@implementation MulleScionMethod ( Printing)
703
+@implementation MulleScionMethod( Printing)
704 704
 
705 705
 static char   *_NSObjCSkipRuntimeTypeQualifier( char *type)
706 706
 {
707 707
    char   c;
708
-   
708
+
709 709
    assert( type != NULL);
710
-   
710
+
711 711
    while( (c = *type) == _C_CONST
712 712
 #ifdef _C_IN
713 713
          || c == _C_IN
... ...
@@ -728,7 +728,7 @@ static char   *_NSObjCSkipRuntimeTypeQualifier( char *type)
728 728
    {
729 729
       type++;
730 730
    }
731
-   
731
+
732 732
    return( type);
733 733
 }
734 734
 
... ...
@@ -753,16 +753,16 @@ static void   *numberBuffer( char *type, NSNumber *value)
753 753
    NSUInteger   size;
754 754
    char         *myType;
755 755
    void         *buf;
756
-   
756
+
757 757
    if( value && ! [value isKindOfClass:[NSValue class]])
758 758
       return( NULL);
759
-   
759
+
760 760
    NSGetSizeAndAlignment( type, &size, &alignment);
761
-   
761
+
762 762
    buf = (void *) [[NSMutableData dataWithLength:size] mutableBytes];
763 763
    if( ! value)
764 764
       return( buf);
765
-   
765
+
766 766
    switch( *type)
767 767
    {
768 768
    case _C_CHR      : *(char *)           buf = [value charValue]; return( buf);
... ...
@@ -781,12 +781,12 @@ static void   *numberBuffer( char *type, NSNumber *value)
781 781
    case _C_BOOL     : *(bool *)           buf = [value boolValue]; return( buf);
782 782
 #endif
783 783
    }
784
-   
784
+
785 785
    myType = (char *) [value objCType];
786 786
    myType = _NSObjCSkipRuntimeTypeQualifier( myType);
787 787
    if( strcmp( myType, type))
788 788
       return( NULL);
789
-   
789
+
790 790
    [value getValue:buf];
791 791
    return( buf);
792 792
 }
... ...
@@ -808,7 +808,7 @@ static void   *numberBuffer( char *type, NSNumber *value)
808 808
    id                     value;
809 809
    id                     result;
810 810
    void                   *tmp;
811
-   
811
+
812 812
    // static char         id_type[ 2] = { _C_ID, 0 };
813 813
 
814 814
    NSParameterAssert( target);
... ...
@@ -816,46 +816,47 @@ static void   *numberBuffer( char *type, NSNumber *value)
816 816
 
817 817
    if( target == MulleScionNull)
818 818
       return( MulleScionNull);
819
-   
819
+
820 820
    pool = [NSAutoreleasePool new];
821
-   
821
+
822 822
    signature = [dataSource mulleScionMethodSignatureForSelector:action_
823 823
                                                          target:target];
824 824
    if( ! signature)
825 825
       MulleScionPrintingException( NSInvalidArgumentException, locals,
826 826
                   @"Method \"%@\" (%p) is unknown on \"%@\"", NSStringFromSelector( action_), (void *) action_, [target class]);
827
-   
827
+
828 828
    // remember varargs, there can be more arguments
829 829
    m = [signature numberOfArguments];
830 830
    n = [arguments_ count] + 2;
831
-   if( m  != n)
831
+   if( m != n)
832 832
       MulleScionPrintingException( NSInvalidArgumentException, locals,
833
-                                  @"Method \"%@\" expects %ld arguments", NSStringFromSelector( action_), (long) n);
834
-   
835
-   
833
+                                  @"Method \"%@\" expects %ld arguments (got %ld)", NSStringFromSelector( action_), (long) n,
834
+                                       (long) m);
835
+
836
+
836 837
    invocation = [NSInvocation invocationWithMethodSignature:signature];
837 838
    [invocation setSelector:action_];
838
-   
839
+
839 840
    for( i = 2; i < n; i++)
840 841
    {
841 842
       expr  = [arguments_ objectAtIndex:i - 2];
842 843
       value = [expr valueWithLocalVariables:locals
843 844
                                  dataSource:dataSource];
844 845
       NSParameterAssert( value);
845
-      
846
+
846 847
       if( value == dataSource) // plug security hole
847 848
          MulleScionPrintingException( NSInvalidArgumentException, locals,
848 849
                                      @"You can't use the dataSource as an argument");
849 850
       if( value == MulleScionNull)
850 851
          value = nil;
851
-         
852
+
852 853
       // type = id_type;  // ok, varargs with non-objects won't work
853 854
       // if( i < m)
854 855
       {
855 856
          type = (char *) [signature getArgumentTypeAtIndex:i];
856