Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: cappuccino/cappuccino
...
head fork: cappuccino/cappuccino
  • 11 commits
  • 14 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 24, 2012
@aljungberg aljungberg Make LintChecker().lint_text('<code>') possible.
Made LintChecker()'s "view" and lint_text's "filename" arguments optional. Filename will default to <stdin> like Python does when you pipe to it. Also return found errors from lint_text as a convenience.
24cce3c
@aljungberg aljungberg Fixed: if linted text didn't end with a newline the last character wo…
…uld be ignored.
0d5b4d4
@aljungberg aljungberg Add some illustrative capp_lint doctests. 1f803f5
@aljungberg aljungberg Report the original line contents in capp_lint.
capp_lint does some preprocessing of lines to simplify the lint tests, but the user will expect the regular, non processed lines in the output.
a7bee74
@aljungberg aljungberg Fixed: capp_lint exponential warnings.
capp_lint issued warnings over numerical literals like 2.1e+6 even that they were correctly formatted.
2b8b570
@aljungberg aljungberg Code formatting. 09d5957
@aljungberg aljungberg Support function argument types in capp_lint.
Syntax such as function(/*CPString*/anArgument) {} should not generate a warning, and in general inline /**/ comments should be ignored for linting purposes.
2a21ce4
@aljungberg aljungberg Remove unary + warning from capp_lint.
A statement like `x = +y;` actually does have an effect in JavaScript.
9ffaf53
@aljungberg aljungberg Format code, fix accidental global. aa4eff9
Commits on May 25, 2012
@aljungberg aljungberg Fixed: capp_lint handling of string literals with escapes.
This could cause capp_lint to warn about what it perceived as code inside of string literals if the string literal ended with an escaped backslash.
1a14ef2
@aljungberg aljungberg Code formatting. 46aabf0
View
8 AppKit/CPCookie.j
@@ -111,8 +111,12 @@
for (var i = 0; i < ca.length; i++)
{
var c = ca[i];
- while (c.charAt(0) == ' ') c = c.substring(1, c.length);
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
+
+ while (c.charAt(0) == ' ')
+ c = c.substring(1, c.length);
+
+ if (c.indexOf(nameEQ) == 0)
+ return c.substring(nameEQ.length, c.length);
}
#endif
return "";
View
7 AppKit/CPGraphics.j
@@ -70,7 +70,10 @@ function CPDrawColorTiledRects(
if (_CGRectIsEmpty(slice))
continue;
- var minX, maxX, minY, maxY;
+ var minX,
+ maxX,
+ minY,
+ maxY;
if (side == CPMinXEdge || side == CPMaxXEdge)
{
@@ -105,4 +108,4 @@ function CPDrawColorTiledRects(
CGContextRestoreGState(context);
return resultRect;
-}
+}
View
2  AppKit/CPLevelIndicator.j
@@ -253,7 +253,7 @@ var _CPLevelIndicatorBezelColor = nil,
var location = [self convertPoint:[anEvent locationInWindow] fromView:nil],
bounds = [self bounds],
- oldValue = [self doubleValue];
+ oldValue = [self doubleValue],
newValue = oldValue;
// Moving the mouse outside of the widget to the left sets it
View
3  AppKit/CPRuleEditor/CPPredicateEditorRowTemplate.j
@@ -185,7 +185,8 @@ CPTransformableAttributeType = 1800;
if (![[self operators] containsObject:[predicate predicateOperatorType]])
return 0;
- if (!_rightIsWildcard && ![[self rightExpressions] containsObject:[predicate rightExpression]]) return 0;
+ if (!_rightIsWildcard && ![[self rightExpressions] containsObject:[predicate rightExpression]])
+ return 0;
return 1;
}
View
4 AppKit/CPWindow/_CPDocModalWindowView.j
@@ -24,7 +24,7 @@ var _CPStandardWindowViewBodyBackgroundColor = nil;
if (self)
{
var theClass = [self class],
- bounds = [self bounds];
+ bounds = [self bounds];
_bodyView = [[CPView alloc] initWithFrame:_CGRectMake(0.0, 0.0, _CGRectGetWidth(bounds), _CGRectGetHeight(bounds))];
@@ -54,4 +54,4 @@ var _CPStandardWindowViewBodyBackgroundColor = nil;
return aContentRect;
}
-@end
+@end
View
10 AppKit/Themes/Default/AppController.j
@@ -31,9 +31,8 @@
[_CPCibCustomResource imageResourceWithName:"horizontal-track-center.png" size:CPSizeMake(1.0, 4.0)],
[_CPCibCustomResource imageResourceWithName:"horizontal-track-right.png" size:CPSizeMake(2.0, 4.0)]
]
- isVertical:NO]];
-
- var horizontalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 24.0)];
+ isVertical:NO]],
+ horizontalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 24.0)];
[horizontalSlider setTrackWidth:4.0];
[horizontalSlider setHorizontalTrackColor:horizontalTrackColor];
@@ -55,9 +54,8 @@
[_CPCibCustomResource imageResourceWithName:"vertical-track-center.png" size:CPSizeMake(4.0, 1.0)],
[_CPCibCustomResource imageResourceWithName:"vertical-track-bottom.png" size:CPSizeMake(4.0, 2.0)]
]
- isVertical:YES]];
-
- var verticalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 24.0, 50.0)];
+ isVertical:YES]],
+ verticalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 24.0, 50.0)];
[verticalSlider setTrackWidth:4];
[verticalSlider setVerticalTrackColor:verticalTrackColor];
View
2  Foundation/CPDate.j
@@ -245,7 +245,7 @@ Date.parseISO8601 = function (date)
if (isNaN(timestamp) && (struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(date)))
{
- // avoid NaN timestamps caused by undefined values being passed to Date.UTC
+ // avoid NaN timestamps caused by "undefined" values being passed to Date.UTC
for (var i = 0, k; (k = numericKeys[i]); ++i)
struct[k] = +struct[k] || 0;
View
5 Foundation/CPDecimal.j
@@ -181,7 +181,7 @@ function CPDecimalMakeWithParts(mantissa, exponent)
var m = [],
isNegative = NO;
- if (mantissa < 0 )
+ if (mantissa < 0)
{
isNegative = YES;
mantissa = ABS(mantissa);
@@ -1400,10 +1400,9 @@ function CPDecimalRound(result, dcm, scale ,roundingMode)
function CPDecimalCompact(dcm)
{
// if positive or zero exp leading zeros simply delete, trailing ones u need to increment exponent
- if (!dcm || dcm._mantissa.length == 0 || CPDecimalIsNotANumber(dcm) )
+ if (!dcm || dcm._mantissa.length == 0 || CPDecimalIsNotANumber(dcm))
return;
-
if (CPDecimalIsZero(dcm))
{
// handle zero number compacting
View
36 Foundation/CPNumber.j
@@ -222,7 +222,8 @@ FIXME: Do we need this?
- (CPString)descriptionWithLocale:(CPDictionary)aDictionary
{
- if (!aDictionary) return toString();
+ if (!aDictionary)
+ return toString();
throw new Error("descriptionWithLocale: NOT YET IMPLEMENTED");
}
@@ -234,37 +235,43 @@ FIXME: Do we need this?
- (double)doubleValue
{
- if (typeof self == "boolean") return self ? 1 : 0;
+ if (typeof self == "boolean")
+ return self ? 1 : 0;
return self;
}
- (float)floatValue
{
- if (typeof self == "boolean") return self ? 1 : 0;
+ if (typeof self == "boolean")
+ return self ? 1 : 0;
return self;
}
- (int)intValue
{
- if (typeof self == "boolean") return self ? 1 : 0;
+ if (typeof self == "boolean")
+ return self ? 1 : 0;
return self;
}
- (long long)longLongValue
{
- if (typeof self == "boolean") return self ? 1 : 0;
+ if (typeof self == "boolean")
+ return self ? 1 : 0;
return self;
}
- (long)longValue
{
- if (typeof self == "boolean") return self ? 1 : 0;
+ if (typeof self == "boolean")
+ return self ? 1 : 0;
return self;
}
- (short)shortValue
{
- if (typeof self == "boolean") return self ? 1 : 0;
+ if (typeof self == "boolean")
+ return self ? 1 : 0;
return self;
}
@@ -280,7 +287,8 @@ FIXME: Do we need this?
- (unsigned int)unsignedIntValue
{
- if (typeof self == "boolean") return self ? 1 : 0;
+ if (typeof self == "boolean")
+ return self ? 1 : 0;
return self;
}
/*
@@ -292,20 +300,24 @@ FIXME: Do we need this?
*/
- (unsigned long)unsignedLongValue
{
- if (typeof self == "boolean") return self ? 1 : 0;
+ if (typeof self == "boolean")
+ return self ? 1 : 0;
return self;
}
- (unsigned short)unsignedShortValue
{
- if (typeof self == "boolean") return self ? 1 : 0;
+ if (typeof self == "boolean")
+ return self ? 1 : 0;
return self;
}
- (CPComparisonResult)compare:(CPNumber)aNumber
{
- if (self > aNumber) return CPOrderedDescending;
- else if (self < aNumber) return CPOrderedAscending;
+ if (self > aNumber)
+ return CPOrderedDescending;
+ else if (self < aNumber) return
+ CPOrderedAscending;
return CPOrderedSame;
}
View
2  Foundation/CPScanner.j
@@ -292,7 +292,7 @@
loc += (""+f).length;
var i = 0;
- while (!isNaN(parseFloat(str.substring(loc+i, str.length))))
+ while (!isNaN(parseFloat(str.substring(loc + i, str.length))))
{i++;}
[self setScanLocation:loc + i];
View
158 Tools/capp_lint/capp_lint
@@ -36,7 +36,7 @@ import os
import os.path
import re
import sys
-
+import unittest
EXIT_CODE_SHOW_HTML = 205
EXIT_CODE_SHOW_TOOLTIP = 206
@@ -77,7 +77,54 @@ def relative_path(basedir, filename):
return filename
+def string_replacer(line):
+ """Take string literals like 'hello' and replace them with empty string literals, while respecting escaping."""
+
+ r = []
+ in_quote = None
+ escapes = 0
+ for i, c in enumerate(line):
+ if in_quote:
+ if not escapes and c == in_quote:
+ in_quote = None
+ r.append(c)
+ continue
+
+ # We're inside of a string literal. Ignore everything.
+ else:
+ if not escapes and (c == '"' or c == "'"):
+ in_quote = c
+ r.append(c)
+ continue
+
+ # Outside of a string literal, preserve everything.
+ r.append(c)
+
+ if c == '\\':
+ escapes = (escapes + 1) % 2
+ else:
+ escapes = 0
+
+ if in_quote:
+ # Unterminated string literal.
+ pass
+ return "".join(r)
+
+
class LintChecker(object):
+ """Examine Objective-J code statically and generate warnings for possible errors and deviations from the coding-style standard.
+
+ >>> LintChecker().lint_text('var b = 5+5;')
+ [{'positions': [9], 'filename': '<stdin>', 'lineNum': 1, 'message': 'binary operator without surrounding spaces', 'type': 2, 'line': u'var b = 5+5;'}]
+
+ >>> LintChecker().lint_text('''
+ ... if( 1 ) {
+ ... var b=7;
+ ... c = 8;
+ ... }
+ ... ''')
+ [{'positions': [2], 'filename': '<stdin>', 'lineNum': 2, 'message': 'missing space between control statement and parentheses', 'type': 2, 'line': u'if( 1 ) {'}, {'positions': [8], 'filename': '<stdin>', 'lineNum': 2, 'message': 'braces should be on their own line', 'type': 1, 'line': u'if( 1 ) {'}, {'positions': [3, 5], 'filename': '<stdin>', 'lineNum': 2, 'message': 'space inside parentheses', 'type': 1, 'line': u'if( 1 ) {'}, {'positions': [7], 'filename': '<stdin>', 'lineNum': 3, 'message': 'assignment operator without surrounding spaces', 'type': 2, 'line': u' var b=7;'}, {'lineNum': 4, 'message': 'accidental global variable', 'type': 1, 'line': u' c = 8;', 'filename': '<stdin>'}]
+ """
VAR_BLOCK_START_RE = re.compile(ur'''(?x)
(?P<indent>\s*) # indent before a var keyword
@@ -128,15 +175,33 @@ class LintChecker(object):
TRAILING_WHITESPACE_RE = re.compile(ur'^.*(\s+)$')
STRIP_LINE_COMMENT_RE = re.compile(ur'(.*)\s*(?://.*|/\*.*\*/\s*)$')
LINE_COMMENT_RE = re.compile(ur'\s*(?:/\*.*\*/\s*|//.*)$')
+ COMMENT_RE = re.compile(ur'/\*.*?\*/')
BLOCK_COMMENT_START_RE = re.compile(ur'\s*/\*.*(?!\*/\s*)$')
BLOCK_COMMENT_END_RE = re.compile(ur'.*?\*/')
METHOD_RE = ur'[-+]\s*\([a-zA-Z_$]\w*\)\s*[a-zA-Z_$]\w*'
FUNCTION_RE = re.compile(ur'\s*function\s*(?P<name>[a-zA-Z_$]\w*)?\(.*\)\s*\{?')
- STRING_LITERAL_RE = re.compile(ur'(?<!\\)(["\'])(.*?)(?<!\\)\1')
RE_RE = re.compile(ur'(?<!\\)/.*?[^\\]/[gims]*')
EMPTY_STRING_LITERAL_FUNCTION = lambda match: match.group(1) + (len(match.group(2)) * ' ') + match.group(1)
EMPTY_SELF_STRING_LITERAL_FUNCTION = lambda self, match: match.group(1) + (len(match.group(2)) * ' ') + match.group(1)
+ def noncapturing(regex):
+ return ur'(?:%s)' % regex
+
+ def optional(regex):
+ return ur'(?:%s)?' % regex
+
+ DECIMAL_DIGIT_RE = ur'[0-9]'
+ NON_ZERO_DIGIT_RE = ur'[1-9]'
+ DECIMAL_DIGITS_RE = DECIMAL_DIGIT_RE + ur'+'
+ DECIMAL_DIGITS_OPT_RE = optional(DECIMAL_DIGIT_RE + ur'+')
+ EXPONENT_INDICATOR_RE = ur'[eE]'
+ SIGNED_INTEGER_RE = noncapturing(DECIMAL_DIGITS_RE) + ur'|' + noncapturing(ur'\+' + DECIMAL_DIGITS_RE) + ur'|' + noncapturing('-' + DECIMAL_DIGITS_RE)
+ DECIMAL_INTEGER_LITERAL_RE = ur'0|' + noncapturing(NON_ZERO_DIGIT_RE + DECIMAL_DIGIT_RE + ur'*')
+ EXPONENT_PART_RE = EXPONENT_INDICATOR_RE + noncapturing(SIGNED_INTEGER_RE)
+ EXPONENT_PART_OPT_RE = optional(EXPONENT_PART_RE)
+
+ DECIMAL_LITERAL_RE = re.compile(noncapturing(noncapturing(DECIMAL_INTEGER_LITERAL_RE) + ur'\.' + DECIMAL_DIGITS_OPT_RE + EXPONENT_PART_OPT_RE) + ur'|\.' + noncapturing(DECIMAL_DIGITS_RE + EXPONENT_PART_OPT_RE) + ur'|' + noncapturing(noncapturing(DECIMAL_INTEGER_LITERAL_RE) + EXPONENT_PART_OPT_RE))
+
ERROR_TYPE_ILLEGAL = 1
ERROR_TYPE_WARNING = 2
@@ -144,10 +209,19 @@ class LintChecker(object):
# with spaces so we don't get false matches within them
STD_IGNORES = (
{'regex': STRIP_LINE_COMMENT_RE, 'replace': ''},
- {'regex': STRING_LITERAL_RE, 'replace': EMPTY_STRING_LITERAL_FUNCTION},
+ {'function': string_replacer},
+ {'regex': COMMENT_RE, 'replace': ''},
{'regex': RE_RE, 'replace': '/ /'},
)
+ # Convert exponential notation like 1.1e-6 to an arbitrary constant number so that the "e" notation doesn't
+ # need to be understood by the regular matchers. Obviously this is limited by the fact that we're regexing
+ # so this will probably catch some things which are not properly decimal literals (parts of strings or
+ # variable names for instance).
+ EXPONENTIAL_TO_SIMPLE = (
+ {'regex': DECIMAL_LITERAL_RE, 'replace': '42'},
+ )
+
LINE_CHECKLIST = (
{
'id': 'tabs',
@@ -197,23 +271,14 @@ class LintChecker(object):
# Filter out @import statements, method declarations, method parameters, unary plus/minus/increment/decrement
'filter': {'regex': re.compile(ur'(^@import\b|^\s*' + METHOD_RE + '|^\s*[a-zA-Z_$]\w*:\s*\([a-zA-Z_$][\w<>]*\)\s*\w+|[a-zA-Z_$]\w*(\+\+|--)|([ -+*/%^&|<>!]=?|&&|\|\||<<|>>>|={1,3}|!==?)\s*[-+][\w(\[])'), 'pass': False},
- 'preprocess': STD_IGNORES,
+ # Also convert literals like 1.5e+7 to 42 so that the - or + in there is ignored for purposes of this warning.
+ 'preprocess': STD_IGNORES + EXPONENTIAL_TO_SIMPLE,
'regex': re.compile(ur'(?<=[\w)\]"\']|([ ]))([-+*/%^]|&&?|\|\|?|<<|>>>?)(?=[\w({\["\']|(?(1)\b\b|[ ]))'),
'error': 'binary operator without surrounding spaces',
'showPositionForGroup': 2,
'type': ERROR_TYPE_WARNING
},
{
- # Filter out @import statements, method declarations
- 'filter': {'regex': re.compile(ur'^(@import\b|\s*' + METHOD_RE + ')'), 'pass': False},
-
- 'preprocess': STD_IGNORES,
- 'regex': re.compile(ur'(?:[-*/%^&|<>!]=?|&&|\|\||<<|>>>|={1,3}|!==?)\s*(?<!\+)(\+)[\w(\[]'),
- 'error': 'useless unary + operator',
- 'showPositionForGroup': 1,
- 'type': ERROR_TYPE_WARNING
- },
- {
# Filter out possible = within @accessors
'filter': {'regex': re.compile(ur'^\s*(?:@outlet\s+)?[a-zA-Z_$]\w*\s+[a-zA-Z_$]\w*\s+@accessors\b'), 'pass': False},
@@ -266,7 +331,7 @@ class LintChecker(object):
TEXT_ERROR_SINGLE_FILE_TEMPLATE = Template(u'$lineNum: $message.\n+$line\n')
TEXT_ERROR_MULTI_FILE_TEMPLATE = Template(u'$filename:$lineNum: $message.\n+$line\n')
- def __init__(self, view, basedir='', var_declarations=VAR_DECLARATIONS_SINGLE, verbose=False):
+ def __init__(self, view=None, basedir='', var_declarations=VAR_DECLARATIONS_SINGLE, verbose=False):
self.view = view
self.basedir = unicode(basedir, 'utf-8')
self.errors = []
@@ -296,6 +361,7 @@ class LintChecker(object):
continue
line = self.line
+ originalLine = line
lineFilter = check.get('filter')
if lineFilter:
@@ -316,6 +382,11 @@ class LintChecker(object):
if regex:
line = regex.sub(processor.get('replace', ''), line)
+ fnct = processor.get('function')
+
+ if fnct:
+ line = fnct(line)
+
regex = check.get('regex')
if not regex:
@@ -352,12 +423,15 @@ class LintChecker(object):
break
if positions:
- self.error(check['error'], line=line, positions=positions, type=check['type'])
+ self.error(check['error'], line=originalLine, positions=positions, type=check['type'])
def next_statement(self, expect_line=False, check_line=True):
try:
while True:
- raw_line = self.sourcefile.next()[:-1] # strip EOL
+ raw_line = self.sourcefile.next()
+ # strip EOL
+ if raw_line[-1] == '\n': # ... unless this is the last line which might not have a \n.
+ raw_line = raw_line[:-1]
try:
self.line = unicode(raw_line, 'utf-8', 'strict') # convert to Unicode
@@ -430,7 +504,7 @@ class LintChecker(object):
# Remove all quoted strings from the expression so that we don't
# count unmatched pairs inside the strings.
- self.expression = self.STRING_LITERAL_RE.sub(self.EMPTY_SELF_STRING_LITERAL_FUNCTION, self.expression)
+ self.expression = string_replacer(self.expression)
self.strip_comment()
self.expression = self.expression.strip()
@@ -747,7 +821,7 @@ class LintChecker(object):
print u'EOF\n'
pass
- def lint_text(self, text, filename):
+ def lint_text(self, text, filename="<stdin>"):
self.filename = filename
self.filesToCheck = []
@@ -759,6 +833,8 @@ class LintChecker(object):
print u'EOF\n'
pass
+ return self.errors
+
def count_files_checked(self):
return len(self.filesToCheck)
@@ -959,6 +1035,50 @@ class LintChecker(object):
exit_show_html(html)
+class MiscTest(unittest.TestCase):
+ def test_string_replacer(self):
+ self.assertEquals(string_replacer("x = 'hello';"), "x = '';")
+ self.assertEquals(string_replacer("x = '\\' hello';"), "x = '';")
+ self.assertEquals(string_replacer("x = '\\\\';"), "x = '';")
+ self.assertEquals(string_replacer("""x = '"string in string"';"""), "x = '';")
+
+ self.assertEquals(string_replacer('x = "hello";'), 'x = "";')
+ self.assertEquals(string_replacer('x = "\\" hello";'), 'x = "";')
+ self.assertEquals(string_replacer('x = "\\\\";'), 'x = "";')
+ self.assertEquals(string_replacer('''x = "'";'''), 'x = "";')
+
+
+class LintCheckerTest(unittest.TestCase):
+ def test_exponential_notation(self):
+ """Test that exponential notation such as 1.1e-6 doesn't cause a warning about missing whitespace."""
+
+ # This should not report "binary operator without surrounding spaces".
+ self.assertEquals(LintChecker().lint_text("a = 2.1e-6;"), [])
+ self.assertEquals(LintChecker().lint_text("a = 2.1e+6;"), [])
+ self.assertEquals(LintChecker().lint_text("a = 2e-0;"), [])
+ self.assertEquals(LintChecker().lint_text("a = 2e+0;"), [])
+
+ # But this should.
+ self.assertEquals(LintChecker().lint_text("a = 1.1e-6+2e2;"), [{'positions': [6], 'filename': '<stdin>', 'lineNum': 1, 'message': 'binary operator without surrounding spaces', 'type': 2, 'line': u'a = 1.1e-6+2e2;'}])
+
+ def test_function_types(self):
+ """Test that function definitions like function(/*CPString*/key) don't cause warnings about surrounding spaces."""
+
+ # This should not report "binary operator without surrounding spaces".
+ self.assertEquals(LintChecker().lint_text("var resolveMultipleValues = function(/*CPString*/key, /*CPDictionary*/bindings, /*GSBindingOperationKind*/operation)"), [])
+
+ def test_unary_plus(self):
+ """Test that = +<variable>, like in `x = +y;`, doesn't cause a warning."""
+
+ # +<variable> converts number in a string to a number.
+ self.assertEquals(LintChecker().lint_text("var y = +x;"), [])
+
+ def test_string_escaping(self):
+ """Test that string literals are not parsed as syntax, even when they end with a double backslash."""
+
+ self.assertEquals(LintChecker().lint_text('var x = "(\\\\";'), [])
+
+
if __name__ == '__main__':
usage = 'usage: %prog [options] [file ... | -]'
parser = OptionParser(usage=usage, version='1.02')
View
10 Tools/nib2cib/NSPredicateEditor.j
@@ -27,12 +27,12 @@
- (id)NS_initWithCoder:(CPCoder)aCoder
{
self = [super NS_initWithCoder:aCoder];
-
+
if (self)
- {
+ {
_allTemplates = [aCoder decodeObjectForKey:@"NSPredicateTemplates"];
}
-
+
return self;
}
@@ -59,7 +59,7 @@
- (id)NS_initWithCoder:(CPCoder)aCoder
{
self = [super init];
-
+
if (self)
{
_templateType = [aCoder decodeIntForKey:@"NSPredicateTemplateType"];
@@ -71,7 +71,7 @@
_rightIsWildcard = [aCoder decodeBoolForKey:@"NSPredicateTemplateRightIsWildcard"];
_views = [aCoder decodeObjectForKey:@"NSPredicateTemplateViews"];
}
-
+
return self;
}
View
12 Tools/nib2cib/NSRuleEditor.j
@@ -32,7 +32,7 @@
- (id)NS_initWithCoder:(CPCoder)aCoder
{
self = [super NS_initWithCoder:aCoder];
-
+
if (self)
{
_alignmentGridWidth = [aCoder decodeFloatForKey:@"NSRuleEditorAlignmentGridWidth"];
@@ -40,20 +40,20 @@
_stringsFilename = [aCoder decodeObjectForKey:@"NSRuleEditorStringsFileName"];
_editable = [aCoder decodeBoolForKey:@"NSRuleEditorEditable"];
_allowsEmptyCompoundRows = [aCoder decodeBoolForKey:@"NSRuleEditorAllowsEmptyCompoundRows"];
- _disallowEmpty = [aCoder decodeBoolForKey:@"NSRuleEditorDisallowEmpty"];
+ _disallowEmpty = [aCoder decodeBoolForKey:@"NSRuleEditorDisallowEmpty"];
_nestingMode = [aCoder decodeIntForKey:@"NSRuleEditorNestingMode"];
_typeKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorRowTypeKeyPath"];
_itemsKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorItemsKeyPath"];
_valuesKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorValuesKeyPath"];
_subrowsArrayKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorSubrowsArrayKeyPath"];
_boundArrayKeyPath = [aCoder decodeObjectForKey:@"NSRuleEditorBoundArrayKeyPath"];
-
+
//_slicesHolder = [aCoder decodeObjectForKey:@"NSRuleEditorViewSliceHolder"];
_boundArrayOwner = [aCoder decodeObjectForKey:@"NSRuleEditorBoundArrayOwner"];
_slices = [aCoder decodeObjectForKey:@"NSRuleEditorSlices"];
- _ruleDelegate = [aCoder decodeObjectForKey:@"NSRuleEditorDelegate"];
+ _ruleDelegate = [aCoder decodeObjectForKey:@"NSRuleEditorDelegate"];
}
-
+
return self;
}
@@ -99,7 +99,7 @@
{
if (self = [super init])
boundArray = [aCoder decodeObjectForKey:@"NSBoundArray"];
-
+
return self;
}
View
2  Tools/nib2cib/Nib2Cib.j
@@ -40,7 +40,7 @@ var FILE = require("file"),
DefaultTheme = "Aristo",
BuildTypes = ["Debug", "Release"],
DefaultFile = "MainMenu",
- AllowedStoredOptionsRe = new RegExp("^(defaultTheme|auxThemes|verbosity|quiet|frameworks|format)$");
+ AllowedStoredOptionsRe = new RegExp("^(defaultTheme|auxThemes|verbosity|quiet|frameworks|format)$"),
ArgsRe = /"[^\"]+"|'[^\']+'|\S+/g;

No commit comments for this range

Something went wrong with that request. Please try again.