Commit Graph
32 Commits
Author SHA1 Message Date
Aparajita Fishman e2ead56256 Collection KVC fixes, nextObject correctness
- Moved common CPArray/CPSet collection KVC operators to _CPCollectionKVCOperators.
- Implemented KVC operator dispatch using Objective-J.
- Fixed infinite loop with empty  collection in @min, @max and @sum operators.
- Correctly return valueForUndefinedKey when necessary.
- valueForUndefinedKey reason uses raw description for consistency, class' overridden description may not helpful at all.
- Don't create a forwarder for @ operators with property paths.
- Fixed CPSet -valueForKeyPath to correctly deal with nil/undefined/empty values.
- Added tests for collection  KVC operators.
- enumerator -nextObject should always compare against nil for clarity, correctness, and consistency.
2012-04-03 22:16:55 -07:00
lynnchin 8cb7c05c88 Update line 171 to remove "%s" to populate the result string. 2012-02-01 19:13:59 +11:00
Aparajita Fishman 1c2a304ee5 Assignment of function is a statement and should be semicolon terminated. Some miscellaneous linting as well. 2012-01-05 17:51:37 -10:00
cacaodev ce2316a8ee CPCompoundPredicate: Fixed typo in -isEqual:. With test. 2011-12-31 16:19:38 +01:00
cacaodev b39f509263 CPArray (CPPredicate): -filteredArrayUsingPredicate: and -filterUsingPredicate:
Use CPArray methods (not js array) because the receiver can be a CPArray subclass. With tests.

Fixes the bug reported here: https://groups.google.com/forum/?pli=1#!topic/objectivej/8q9hqbZZUv0
2011-12-29 17:16:53 +01:00
cacaodev 1ea95bf6e0 CPExpression: renamed private classes to follow naming rules. 2011-12-17 16:10:06 +01:00
cacaodev 08d690b65d Completed isEqual: support for CPExpression & CPPredicate subclasses 2011-12-17 15:37:43 +01:00
Aparajita Fishman e17d8ca302 Pin ranges to valid values. 2011-05-26 14:31:13 -07:00
Aparajita Fishman 3937e66e06 Major fix to documentation generation:
- It turns out doxygen would not generate documentation for the first method in a file (or sometimes any methods at all) if there was no ivar block or an empty ivar block. Now a dummy __doxygen__ ivar is inserted in empty blocks to force correct behavior.

- Added a missing @endverbatim to CPExpression.j.

- Tweaked class documentation for CPPredicate.j.
2011-05-19 16:47:11 -07:00
Aparajita Fishman 634fa7b850 Stupid Uber Glory bundle duplicated the file a few times when stripping whitespace. 2011-05-18 17:33:30 -07:00
Aparajita Fishman f132ec5a50 Fixed formatting of lists and code in class description. The code did not change, I don't know why git says it did. 2011-05-18 16:55:43 -07:00
Stephen Ierodiaconou 37323b811c Merge branch 'master' of git://github.com/280north/cappuccino into imports
Conflicts:
	Foundation/CPDecimalNumber.j
	Foundation/CPPredicate/CPComparisonPredicate.j
	Foundation/CPPredicate/CPCompoundPredicate.j
	Foundation/CPPredicate/CPExpression.j
	Foundation/CPPredicate/CPExpression_aggregate.j
	Foundation/CPPredicate/CPExpression_constant.j
	Foundation/CPPredicate/CPExpression_function.j
	Foundation/CPPredicate/CPExpression_keypath.j
	Foundation/CPPredicate/CPExpression_self.j
	Foundation/CPPredicate/CPExpression_set.j
	Foundation/CPPredicate/CPExpression_subquery.j
	Foundation/CPPredicate/CPExpression_variable.j
	Foundation/CPPredicate/CPPredicate.j
2011-01-16 10:03:42 +02:00
Stephen Ierodiaconou 494f615aaa Merge branch 'master' into imports
Conflicts:
	Foundation/CPScanner.j
2011-01-15 09:11:46 +02:00
cacaodev 9c6476615d Allow parsing of functions with multiple arguments like multiply:by:(5,2) or FUNCTION('method:arg:', arg1, arg2)
Added a missing CPDate.j import in CPExpression_function that was causing an 'unknown variable CPDate' error in deploy builds.
Added documentation for +expressionForSubquery:...
Added licence headers with credits.
2011-01-12 18:43:09 +01:00
Francisco Ryan Tolmasky I 37931f08b5 First pass at CPArray class cluster.
Reviewed by me.
2010-12-25 16:07:30 -08:00
Stephen Ierodiaconou 66b6b44f86 CPPredicate lint, import fixes, and some bug fixes 2010-12-26 01:34:43 +02:00
Alexander Ljungberg 345b9d9297 Fix some comments. 2010-11-11 13:38:16 -03:00
cacaodev ca289e081e CPPredicate parsing support:
"($)path.($)variable"
 "SUBQUERY(collection, $x,$x = 2)"
 "sum:(arg1, ...)"
 "FUNCTION(target, selector, arg1, ...)
 "object[expression]"
 "set UNION|INTERSECT|MINUS otherset"
Fixed a bug where CPExpression_set was evaluating to an expression instead of a set.
Replaced parsing exceptions with a generic function indicating where it failed.
2010-11-07 17:56:22 +01:00
cacaodev 4b1fbf1eff Implemented subquery expressions.
Added missing getters in CPExpression.
Added a type: argument to FunctionExpression initializer used by  subclasses to init super with their own type.
Fixed evaluation with bindings dictionary in CPExpression_variable. Allow values in bindings to be a constant or an expression (per cocoa).

Tests: added tests for subqueryExpressions, for variableExpression evaluation where the value in the bindings dictionary can be either a constant or another expression.
Parsing a simple variable expression works (e.g. '$x = 12'), parsing a variable in a combined path (e.g.
'$x.path = 12' won't yet.
2010-10-29 18:58:29 +02:00
Alexander Ljungberg 7626af00e7 Apply Cappuccino code style. 2010-10-27 20:16:14 -03:00
cacaodev 2a95523577 CPPredicate & CPExpression changes:
Parsing: fixed typos in built-in function names, fixed support for [FIRST], [LAST], [INDEX]
	Fixed aggregates {exp1,exp2}
Fixed -expressionForFunction:selectorName:arguments:
built-in functions are now class methods
Cleaned a lot of code in built-in functions
EvaluatedObjectExpression is now a singleton
Merged inserset/minus/union Set into one file
Deleted unused expression subclasses : expression_operator and expression_assignement
Added CPCoding methods and changed key names to match Cocoa
Made KeyPathExpresion a subclass of FunctionExpression like in Cocoa
Tests
2010-10-27 00:57:31 +02:00
cacaodev c735399ca5 CPPredicate: Fix for fail when parsing empty quotes. With Tests. 2010-10-23 09:26:12 +02:00
cacaodev 275f89a340 CPPredicate: parsing 'BETWEEN' or 'CONTAINS' keywords now generates predicates with their corresponding operators. Some code style.
CPComparisonPredicate: fixed typo in 'between' operator evaluation, simplified 'contains' and 'in'  evaluation.
Added tests in CPPredicateTest for theses fixes.
2010-10-22 22:13:57 +02:00
Klaas Pieter Annema ddad10b615 fix CPPredicate predicateWithFormat: throwing exception (in WebKit)
I believe the exception was caused because WebKit thought arguments was the function.Arguments.
Issue was resolved by renaming the local arguments variable to args
2010-08-26 16:55:05 +02:00
Alexander Ljungberg 271bb00147 Marginally faster filter and sort in CPArrayController's arrangeObjects (4% in the performance tester.) Reduced memory usage when both a filter and a sort order are applied. Cleanup of the tester and a filter only test run. 2010-08-09 17:31:36 -04:00
cacaodevandAlexander Ljungberg 750cd3c258 CPComparisonPredicate :
Fixed a bug where *lhs custom_selector: nil* was always returning false.
Test nil on left and/or right with some operators.
2010-08-05 16:18:18 -04:00
Alexander Ljungberg df358ccc42 Fix failing CPPredicate unit tests: comment out test for unimplemented expressionForSubquery, finish CPExpression_unionset and fix typo in CPExpression expressionForIntersectSet. 2010-08-04 21:27:01 -04:00
Alexander Ljungberg 63dfb8a227 CPPredicate optimization: early out in failing AND expression. 2010-08-04 20:50:36 -04:00
Alexander Ljungberg a3c0590218 Fixed with CPPredicate: [CPArray arrayWithObjects:...] should no longer be terminated with a nil in Cappuccino. 2010-08-04 20:50:07 -04:00
cacaodevandAlexander Ljungberg c694c96a32 CPPredicate & co style cleaning 2010-08-04 20:45:06 -04:00
Alexander Ljungberg 30bc304a20 Whitespace and style fixes. 2010-08-04 20:23:35 -04:00
cacaodevandAlexander Ljungberg 974cf64e1d CPPredicate &al implementation. OJUnit test. 2010-08-04 19:53:44 -04:00