Skip to content

Commit a5fd02b

Browse files
committed
Fix swift subscript
1 parent 328991d commit a5fd02b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ -(void) captureReturnType
2121
self.hasReturn = NO;
2222
} else if ([funcSignatureWithoutParams vv_matchesPatternRegexPattern:@"s*->\\s*"]) {
2323
self.hasReturn = YES;
24-
} else if ([funcSignatureWithoutParams vv_matchesPatternRegexPattern:@"^\\s*(.*\\s+)?init\\s*"]) {
24+
} else if ([funcSignatureWithoutParams vv_matchesPatternRegexPattern:@"^\\s*(.*\\s+)?(init|subscript)\\s*"]) {
2525
self.hasReturn = YES;
2626
} else {
2727
self.hasReturn = NO;

VVDocumenter-Xcode/OCCategory/NSString+VVSyntax/NSString+VVSyntax.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ -(BOOL) vv_isComplieKeyword
7171

7272
-(BOOL) vv_isSwiftFunction
7373
{
74-
return ![self vv_isObjCMethod] && ![self vv_isSwiftProperty] && [self vv_matchesPatternRegexPattern:@"^\\s*(.*\\s+)?(func\\s+)|(init|deinit)"];
74+
return ![self vv_isObjCMethod] && ![self vv_isSwiftProperty] && [self vv_matchesPatternRegexPattern:@"^\\s*(.*\\s+)?(func\\s+)|(init|deinit|subscript)"];
7575
}
7676

7777
-(BOOL) vv_isSwiftEnum

0 commit comments

Comments
 (0)