Revision: 3043
http://skim-app.svn.sourceforge.net/skim-app/?rev=3043&view=rev
Author: hofman
Date: 2007-10-14 14:22:34 -0700 (Sun, 14 Oct 2007)
Log Message:
-----------
Remove empty line after last collection or condition tag.
Modified Paths:
--------------
trunk/SKTemplateParser.m
Modified: trunk/SKTemplateParser.m
===================================================================
--- trunk/SKTemplateParser.m 2007-10-14 17:15:57 UTC (rev 3042)
+++ trunk/SKTemplateParser.m 2007-10-14 21:22:34 UTC (rev 3043)
@@ -842,24 +842,26 @@
@implementation NSScanner (SKTemplateParser)
- (BOOL)scanEmptyLine {
- BOOL foundNewline = NO;
+ BOOL foundEndOfLine = NO;
BOOL foundWhitespace = NO;
int startLoc = [self scanLocation];
// [self scanCharactersFromSet:[NSCharacterSet whitespaceCharacterSet]
intoString:nil] is much more sensible, but NSScanner creates an autoreleased
inverted character set every time you use it, so it's pretty inefficient
foundWhitespace = [self scanUpToCharactersFromSet:[NSCharacterSet
nonWhitespaceCharacterSet] intoString:nil];
- if ([self isAtEnd] == NO) {
- foundNewline = [self scanString:@"\r\n" intoString:nil];
- if (foundNewline == NO) {
+ if ([self isAtEnd]) {
+ foundEndOfLine == foundWhiteSpace;
+ } else {
+ foundEndOfLine = [self scanString:@"\r\n" intoString:nil];
+ if (foundEndOfLine == NO) {
unichar nextChar = [[self string] characterAtIndex:[self
scanLocation]];
- if (foundNewline = [[NSCharacterSet newlineCharacterSet]
characterIsMember:nextChar])
+ if (foundEndOfLine = [[NSCharacterSet newlineCharacterSet]
characterIsMember:nextChar])
[self setScanLocation:[self scanLocation] + 1];
}
}
- if (foundNewline == NO && foundWhitespace == YES)
+ if (foundEndOfLine == NO && foundWhitespace == YES)
[self setScanLocation:startLoc];
- return foundNewline;
+ return foundEndOfLine;
}
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit