Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (32 sloc) 0.828 kb
ee99867 @ccgus oh geeze
authored
1 //
2 // TDReservedWord.m
3 // TDParseKit
4 //
5 // Created by Todd Ditchendorf on 8/13/08.
6 // Copyright 2008 Todd Ditchendorf. All rights reserved.
7 //
8
9 #import "TDReservedWord.h"
10 #import "TDToken.h"
11
12 static NSArray *sTDReservedWords = nil;
13
14 @interface TDReservedWord ()
15 + (NSArray *)reservedWords;
16 @end
17
18 @implementation TDReservedWord
19
20 + (NSArray *)reservedWords {
21 return [[sTDReservedWords retain] autorelease];
22 }
23
24
25 + (void)setReservedWords:(NSArray *)inWords {
26 if (inWords != sTDReservedWords) {
27 [sTDReservedWords autorelease];
28 sTDReservedWords = [inWords copy];
29 }
30 }
31
32
33 - (BOOL)qualifies:(id)obj {
34 TDToken *tok = (TDToken *)obj;
35 if (!tok.isWord) {
36 return NO;
37 }
38
39 NSString *s = tok.stringValue;
40 return s.length && [[TDReservedWord reservedWords] containsObject:s];
41 }
42
43 @end
Something went wrong with that request. Please try again.