Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 859ce8209afaa44ded51ba57d9fe2b87af1c18a9 1 parent 5e3afaa
Ayal Spitz aspitz authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  CoreParse/Grammar/CPGrammar.m
2  CoreParse/Grammar/CPGrammar.m
@@ -75,7 +75,7 @@ - (id)parser:(CPParser *)parser didProduceSyntaxTree:(CPSyntaxTree *)syntaxTree
75 75 {
76 76 NSString *name = [(CPIdentifierToken *)[children objectAtIndex:0] identifier];
77 77 Class c = NSClassFromString(name);
78   - CPRule *rule = nil == c || !class_conformsToProtocol(c, @protocol(CPParseResult)) ? [CPRule ruleWithName:name rightHandSideElements:rhs] : [CPRule ruleWithName:name rightHandSideElements:rhs representitiveClass:c];
  78 + CPRule *rule = nil == c || ![c conformsToProtocol:@protocol(CPParseResult)] ? [CPRule ruleWithName:name rightHandSideElements:rhs] : [CPRule ruleWithName:name rightHandSideElements:rhs representitiveClass:c];
79 79 [rules addObject:rule];
80 80 }
81 81 return rules;

0 comments on commit 859ce82

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