Source

Silver / Classes / Core / SVIncludeStatement.m

//
//  SVIncludeStatement.m
//  Silver
//
//  Created by Michael Tindal on 2/4/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "SVIncludeStatement.h"
#import "SVVariable.h"

@implementation SVIncludeStatement

+ (SVIncludeStatement *) includeStatementWithArgument:(id)argument {
    return [[self alloc] initWithArgument:argument];
}

- (id) initWithArgument:(id)argument {
    if((self = [super init])) {
        self.argument = argument;
    }
    return self;
}

- (id) evaluateWithContext:(NSMutableDictionary *)context {
    id arg;
    if([self.argument isKindOfClass:[NSString class]])
        arg = [SVVariable variableWithName:self.argument];
    else
        arg = self.argument;
    
    return [arg evaluateWithContext:context];
}

@synthesize argument = argument_;
@end