Revision: 5075
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5075&view=rev
Author:   hofman
Date:     2008-12-18 10:56:44 +0000 (Thu, 18 Dec 2008)

Log Message:
-----------
remove category method for character set and move it privately to template 
parser

Modified Paths:
--------------
    trunk/NSCharacterSet_SKExtensions.h
    trunk/NSCharacterSet_SKExtensions.m
    trunk/SKTemplateParser.m

Modified: trunk/NSCharacterSet_SKExtensions.h
===================================================================
--- trunk/NSCharacterSet_SKExtensions.h 2008-12-17 18:37:10 UTC (rev 5074)
+++ trunk/NSCharacterSet_SKExtensions.h 2008-12-18 10:56:44 UTC (rev 5075)
@@ -40,6 +40,5 @@
 
 
 @interface NSCharacterSet (SKExtensions)
-+ (id)nonWhitespaceCharacterSet;
 + (id)nonWhitespaceAndNewlineCharacterSet;
 @end

Modified: trunk/NSCharacterSet_SKExtensions.m
===================================================================
--- trunk/NSCharacterSet_SKExtensions.m 2008-12-17 18:37:10 UTC (rev 5074)
+++ trunk/NSCharacterSet_SKExtensions.m 2008-12-18 10:56:44 UTC (rev 5075)
@@ -54,13 +54,6 @@
     return newlineCharacterSet;
 }
 
-+ (id)nonWhitespaceCharacterSet {
-    static NSCharacterSet *nonWhitespaceCharacterSet = nil;
-    if (nonWhitespaceCharacterSet == nil)
-        nonWhitespaceCharacterSet = [[[NSCharacterSet whitespaceCharacterSet] 
invertedSet] copy];
-    return nonWhitespaceCharacterSet;
-}
-
 + (id)nonWhitespaceAndNewlineCharacterSet {
     static NSCharacterSet *nonWhitespaceAndNewlineCharacterSet = nil;
     if (nonWhitespaceAndNewlineCharacterSet == nil)

Modified: trunk/SKTemplateParser.m
===================================================================
--- trunk/SKTemplateParser.m    2008-12-17 18:37:10 UTC (rev 5074)
+++ trunk/SKTemplateParser.m    2008-12-18 10:56:44 UTC (rev 5075)
@@ -38,8 +38,6 @@
 
 #import "SKTemplateParser.h"
 #import "SKTemplateTag.h"
-#import "NSCharacterSet_SKExtensions.h"
-#import "SKRuntime.h"
 
 #define START_TAG_OPEN_DELIM            @"<$"
 #define END_TAG_OPEN_DELIM              @"</$"
@@ -73,16 +71,18 @@
 
 static NSCharacterSet *keyCharacterSet = nil;
 static NSCharacterSet *invertedKeyCharacterSet = nil;
+static NSCharacterSet *nonWhitespaceCharacterSet = nil;
 
 + (void)initialize {
-    OBINITIALIZE;
-    
-    NSMutableCharacterSet *tmpSet = [[NSCharacterSet alphanumericCharacterSet] 
mutableCopy];
+    NSMutableCharacterSet *tmpSet = [NSCharacterSet 
characterSetWithRange:NSMakeRange('a', 26)];
+    [tmpSet addCharactersInRange:NSMakeRange('A', 26)];
+    [tmpSet addCharactersInRange:NSMakeRange('0', 10)];
     [tmpSet addCharactersInString:@"....@#"];
     keyCharacterSet = [tmpSet copy];
-    [tmpSet release];
     
     invertedKeyCharacterSet = [[keyCharacterSet invertedSet] copy];
+    
+    nonWhitespaceCharacterSet = [[[NSCharacterSet whitespaceCharacterSet] 
invertedSet] copy];
 }
 
 static inline NSString *templateTagWithKeyPathAndDelims(NSMutableDictionary 
**dict, NSString *keyPath, NSString *openDelim, NSString *closeDelim) {
@@ -218,7 +218,7 @@
     
     if (typeAfter == SKCollectionTemplateTagType || typeAfter == 
SKConditionTemplateTagType || (isSubtemplate && typeAfter == -1)) {
         // remove whitespace at the end, just before the collection or 
condition tag
-        NSRange lastCharRange = [string 
rangeOfCharacterFromSet:[NSCharacterSet nonWhitespaceCharacterSet] 
options:NSBackwardsSearch range:range];
+        NSRange lastCharRange = [string 
rangeOfCharacterFromSet:nonWhitespaceCharacterSet options:NSBackwardsSearch 
range:range];
         if (lastCharRange.location != NSNotFound) {
             unichar lastChar = [string 
characterAtIndex:lastCharRange.location];
             unsigned int rangeEnd = NSMaxRange(lastCharRange);
@@ -230,7 +230,7 @@
     }
     if (typeBefore == SKCollectionTemplateTagType || typeBefore == 
SKConditionTemplateTagType || (isSubtemplate && typeBefore == -1)) {
         // remove whitespace and a newline at the start, just after the 
collection or condition tag
-        NSRange firstCharRange = [string 
rangeOfCharacterFromSet:[NSCharacterSet nonWhitespaceCharacterSet] options:0 
range:range];
+        NSRange firstCharRange = [string 
rangeOfCharacterFromSet:nonWhitespaceCharacterSet options:0 range:range];
         if (firstCharRange.location != NSNotFound) {
             unichar firstChar = [string 
characterAtIndex:firstCharRange.location];
             unsigned int rangeEnd = NSMaxRange(firstCharRange);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to