Add init method to Tokenizer header and extend to accept string parameter
This commit is contained in:
@@ -15,4 +15,6 @@
|
||||
*/
|
||||
@interface HTMLTokenizer : NSObject <NSFastEnumeration>
|
||||
|
||||
- (instancetype)initWithString:(NSString *)string;
|
||||
|
||||
@end
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
- (instancetype)init
|
||||
- (instancetype)initWithString:(NSString *)string
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
@@ -62,6 +62,8 @@
|
||||
[self setupStateMachine];
|
||||
|
||||
_tokens = [NSMutableArray new];
|
||||
|
||||
_inputStreamReader = [[HTMLInputStreamReader alloc] initWithString:string];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user