Fixed bugs: canParse & expected type error & html entities method name

This commit is contained in:
relikd
2019-01-15 22:08:23 +01:00
parent ca9452bc18
commit 8e5938972d
5 changed files with 53 additions and 38 deletions

View File

@@ -118,9 +118,9 @@
});
}
/// @return @c YES if @c .xmlInputError is not @c nil.
/// @return @c YES if @c .xmlInputError is @c nil.
- (BOOL)canParse {
return (self.xmlInputError != nil);
return (self.xmlInputError == nil);
}
@@ -150,10 +150,10 @@
if (!xmlParserClass)
return NO;
if (xmlParserClass != [self class]) { // && !_xmlInputError
RSXMLError current = [self getExpectedErrorForClass:[self class]];
RSXMLError expected = [self getExpectedErrorForClass:xmlParserClass];
RSXMLError current = [self getExpectedErrorForClass:xmlParserClass];
RSXMLError expected = [self getExpectedErrorForClass:[self class]];
if (current != expected) {
_xmlInputError = RSXMLMakeErrorWrongParser(current, expected);
_xmlInputError = RSXMLMakeErrorWrongParser(expected, current);
return NO;
}
}