mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-28 14:37:04 +00:00
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.
44 lines
629 B
Plaintext
44 lines
629 B
Plaintext
|
|
@import "CPExpression.j"
|
|
@import <Foundation/CPString.j>
|
|
@import <Foundation/CPDictionary.j>
|
|
@import <Foundation/CPCoder.j>
|
|
|
|
@implementation CPExpression_self : CPExpression
|
|
{
|
|
}
|
|
|
|
- (id)init
|
|
{
|
|
[super initWithExpressionType:CPEvaluatedObjectExpressionType];
|
|
|
|
return self;
|
|
}
|
|
|
|
- (id)initWithCoder:(CPCoder)coder
|
|
{
|
|
return [self init];
|
|
}
|
|
|
|
- (void)encodeWithCoder:(CPCoder)coder
|
|
{
|
|
}
|
|
|
|
- (BOOL)isEqual:(id)object
|
|
{
|
|
return (_type == CPEvaluatedObjectExpressionType);
|
|
}
|
|
|
|
- (id)expressionValueWithObject:(id)object context:(CPDictionary)context
|
|
{
|
|
return object;
|
|
}
|
|
|
|
- (CPString)description
|
|
{
|
|
return @"SELF";
|
|
}
|
|
|
|
@end
|
|
|