Add description methods for HTML tokens

This commit is contained in:
iska
2014-10-25 01:07:23 +02:00
parent d4401c0f17
commit 0a92fb8eb4
5 changed files with 27 additions and 6 deletions
+2 -6
View File
@@ -26,13 +26,9 @@
return self;
}
- (instancetype)initWithString:(NSString *)string
- (NSString *)description
{
self = [super init];
if (self) {
_characters = [string copy];
}
return self;
return [NSString stringWithFormat:@"<%@: %p Characters=%@>", self.class, self, _characters];
}
@end
+5
View File
@@ -32,4 +32,9 @@
[_data appendString:string];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p Data=%@>", self.class, self, _data];
}
@end
+5
View File
@@ -33,4 +33,9 @@
[_name appendString:string];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p Name=%@>", self.class, self, _name];
}
@end
+5
View File
@@ -19,4 +19,9 @@
return self;
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p EOF>", self.class, self];
}
@end
+10
View File
@@ -48,6 +48,11 @@
return self;
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p TagName=%@>", self.class, self, self.tagName];
}
@end
@implementation HTMLEndTagToken
@@ -61,4 +66,9 @@
return self;
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p TagName=%@>", self.class, self, self.tagName];
}
@end