Skip to content
This repository

Fixed: missing protocol bug for @propety of type `id<...>` #226

Merged
merged 2 commits into from almost 2 years ago

2 participants

Matt Rubin tomaz
Matt Rubin

Fixed a bug which caused the first protocol token in a @property of type id<...> to not be parsed. Closes Issue #218

tomaz
Owner
tomaz commented

Just merged, thanks! Was on vacation so it took me a while :)

tomaz tomaz merged commit 3ee2256 into from
tomaz tomaz closed this
Matt Rubin mattrubin deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 2 authors.

Jul 02, 2012
Matt Rubin mattrubin Fixed a bug which caused the first protocol token in a @property of t…
…ype `id<...>` to not be parsed. Closes Issue #218
fe280df
Matt Rubin mattrubin Improved method parsing test to check for the problem mentioned in is…
…sue #218
00d7b13
This page is out of date. Refresh to see the latest.
1  Model/GBMethodData.m
@@ -74,7 +74,6 @@ + (id)propertyDataWithAttributes:(NSArray *)attributes components:(NSArray *)com
74 74 nextComponentIsPropertyName = YES;
75 75 } else if ([component isEqualToString:@"id"]) {
76 76 [results addObject:component];
77   - nextComponentIsPropertyName = YES;
78 77 } else if ([component isMatchedByRegex:@"^[_a-zA-Z][_a-zA-Z0-9]$"]) {
79 78 if (results.count == 0 || inProtocolsList) {
80 79 [results addObject:component];
4 Testing/GBObjectiveCParser-MethodsParsingTesting.m
@@ -283,12 +283,12 @@ - (void)testParseObjectsFromString_shouldRegisterComplexPropertyDefinition2 {
283 283 GBObjectiveCParser *parser = [GBObjectiveCParser parserWithSettingsProvider:[GBTestObjectsRegistry mockSettingsProvider]];
284 284 GBStore *store = [[GBStore alloc] init];
285 285 // execute
286   - [parser parseObjectsFromString:@"@interface MyClass @property (weak) IBOutlet id delegate; @end" sourceFile:@"filename.h" toStore:store];
  286 + [parser parseObjectsFromString:@"@interface MyClass @property (weak) IBOutlet id<Protocol> delegate; @end" sourceFile:@"filename.h" toStore:store];
287 287 // verify
288 288 GBClassData *class = [[store classes] anyObject];
289 289 NSArray *methods = [[class methods] methods];
290 290 assertThatInteger([methods count], equalToInteger(1));
291   - [self assertMethod:[methods objectAtIndex:0] matchesPropertyComponents:@"weak", @"IBOutlet", @"id", @"delegate", nil];
  291 + [self assertMethod:[methods objectAtIndex:0] matchesPropertyComponents:@"weak", @"IBOutlet", @"id", @"<", @"Protocol", @">", @"delegate", nil];
292 292 }
293 293
294 294 - (void)testParseObjectsFromString_shouldRegisterBlockPropertyDefinition {

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.