Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

77 lines (56 sloc) 1.164 kB
@import "TDWord.j"
@implementation TDLowercaseWord : TDWord
{
}
- (BOOL)qualifies:(id)obj
{
if (!obj.isWord)
return NO;
var s = obj.stringValue;
return s.length && s.charAt(0) === s.charAt(0).toLowerCase();
}
@end
@implementation TDUppercaseWord : TDWord
{
}
- (BOOL)qualifies:(id)obj
{
if (!obj.isWord)
return NO;
var s = obj.stringValue;
return s.length && s.charAt(0) === s.charAt(0).toUpperCase();
}
@end
var sTDReservedWords = nil;
@implementation TDReservedWord : TDWord
{
}
+ (CPArray)reservedWords
{
return sTDReservedWords;
}
+ (void)setReservedWords:(CPArray)inWords
{
if (inWords !== sTDReservedWords) {
sTDReservedWords = [inWords copy];
}
}
- (BOOL)qualifies:(id)obj
{
if (!obj.isWord)
return NO;
var s = obj.stringValue;
return s.length && [[TDReservedWord reservedWords] containsObject:s];
}
@end
@implementation TDNonReservedWord : TDWord
{
}
- (BOOL)qualifies:(id)obj
{
if (!obj.isWord)
return NO;
var s = obj.stringValue;
return s.length && ![[TDReservedWord reservedWords] containsObject:s];
}
@end
Jump to Line
Something went wrong with that request. Please try again.