Skip to content

Commit 4a41b89

Browse files
committed
Update tokenizer implementation as per spec as of 2017.09.09
- Use new initial states in tests according to: html5lib/html5lib-tests#101 - Implement tokenization errors introduced in: whatwg/html#2701 html5lib/html5lib-tests#92
1 parent d4ff2e3 commit 4a41b89

8 files changed

+914
-671
lines changed

Sources/HTMLParseErrorToken.m

+14
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ - (instancetype)initWithCode:(NSString *)code details:(NSString *)details locati
3333
return self;
3434
}
3535

36+
- (BOOL)isEqual:(id)other
37+
{
38+
if ([other isKindOfClass:[self class]]) {
39+
HTMLParseErrorToken *token = (HTMLParseErrorToken *)other;
40+
return bothNilOrEqual(self.code, token.code);
41+
}
42+
return NO;
43+
}
44+
45+
- (NSUInteger)hash
46+
{
47+
return self.code.hash + self.code.hash;
48+
}
49+
3650
- (NSString *)description
3751
{
3852
return [NSString stringWithFormat:@"<%@: %p Code='%@' Details='%@' Location='%lu'>", self.class, self, _code, _details, (unsigned long)_location];

0 commit comments

Comments
 (0)