mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 21:17:03 +00:00
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
54 lines
829 B
Plaintext
54 lines
829 B
Plaintext
|
|
@import "CPExpression.j"
|
|
@import <Foundation/CPString.j>
|
|
@import <Foundation/CPDictionary.j>
|
|
@import <Foundation/CPCoder.j>
|
|
|
|
var defaultInstance = nil;
|
|
@implementation CPExpression_self : CPExpression
|
|
{
|
|
}
|
|
|
|
- (id)init
|
|
{
|
|
if (defaultInstance == nil)
|
|
{
|
|
[super initWithExpressionType:CPEvaluatedObjectExpressionType];
|
|
defaultInstance = self;
|
|
}
|
|
|
|
return defaultInstance;
|
|
}
|
|
|
|
- (id)initWithCoder:(CPCoder)coder
|
|
{
|
|
return [self init];
|
|
}
|
|
|
|
- (void)encodeWithCoder:(CPCoder)coder
|
|
{
|
|
}
|
|
|
|
- (BOOL)isEqual:(id)object
|
|
{
|
|
return (object === self);
|
|
}
|
|
|
|
- (id)expressionValueWithObject:(id)object context:(CPDictionary)context
|
|
{
|
|
return object;
|
|
}
|
|
|
|
- (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)variables
|
|
{
|
|
return self;
|
|
}
|
|
|
|
- (CPString)description
|
|
{
|
|
return @"SELF";
|
|
}
|
|
|
|
@end
|
|
|