Skip to content
Browse files

Switched CPGrammar 'conformsToProtocol' test from 'class_conformsToPr…

…otocol' to NSObjects 'conformsToProtocol'. NSObjects 'conformsToProtocol' actually takes the class hierarchy into account where 'class_conformsToProtocol' does not.
  • Loading branch information...
1 parent 5e3afaa commit 859ce8209afaa44ded51ba57d9fe2b87af1c18a9 @aspitz aspitz committed Oct 4, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 CoreParse/Grammar/CPGrammar.m
View
2 CoreParse/Grammar/CPGrammar.m
@@ -75,7 +75,7 @@ - (id)parser:(CPParser *)parser didProduceSyntaxTree:(CPSyntaxTree *)syntaxTree
{
NSString *name = [(CPIdentifierToken *)[children objectAtIndex:0] identifier];
Class c = NSClassFromString(name);
- CPRule *rule = nil == c || !class_conformsToProtocol(c, @protocol(CPParseResult)) ? [CPRule ruleWithName:name rightHandSideElements:rhs] : [CPRule ruleWithName:name rightHandSideElements:rhs representitiveClass:c];
+ CPRule *rule = nil == c || ![c conformsToProtocol:@protocol(CPParseResult)] ? [CPRule ruleWithName:name rightHandSideElements:rhs] : [CPRule ruleWithName:name rightHandSideElements:rhs representitiveClass:c];
[rules addObject:rule];
}
return rules;

0 comments on commit 859ce82

Please sign in to comment.
Something went wrong with that request. Please try again.