Add description methods for HTML tokens
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -32,4 +32,9 @@
|
||||
[_data appendString:string];
|
||||
}
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@: %p Data=%@>", self.class, self, _data];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -33,4 +33,9 @@
|
||||
[_name appendString:string];
|
||||
}
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@: %p Name=%@>", self.class, self, _name];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -19,4 +19,9 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@: %p EOF>", self.class, self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user