Skip to content

Commit

Permalink
Handled the usage of RegexKitLite in ARC environment (simply turned o…
Browse files Browse the repository at this point in the history
…ff ARC when compiling the RegexKitLite source), then removed the conditional compilation for qualifies in the PKPattern class.
  • Loading branch information
Dave Sieh committed Oct 24, 2012
1 parent 10a40f2 commit 3f8715b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
3 changes: 2 additions & 1 deletion ParseKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@
D3FD79210F4CC87900BAD816 /* rubyhash.grammar in Resources */ = {isa = PBXBuildFile; fileRef = D3FD791F0F4CC86800BAD816 /* rubyhash.grammar */; };
D3FDC4A50FFB3B2A00F1F797 /* RegexKitLite.h in Headers */ = {isa = PBXBuildFile; fileRef = D36C55FC0FD3617B00141CB7 /* RegexKitLite.h */; };
D3FDC6DA0FFC4C8C00F1F797 /* RegexKitLite.h in Headers */ = {isa = PBXBuildFile; fileRef = D36C55FC0FD3617B00141CB7 /* RegexKitLite.h */; };
D3FDC6EE0FFC4C9E00F1F797 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = D36C55FD0FD3617B00141CB7 /* RegexKitLite.m */; };
D3FDC6EE0FFC4C9E00F1F797 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = D36C55FD0FD3617B00141CB7 /* RegexKitLite.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
D3FDC6EF0FFC4C9E00F1F797 /* PKReader.m in Sources */ = {isa = PBXBuildFile; fileRef = D34BAD9B0FF9C95800D7773A /* PKReader.m */; };
D3FDC6F00FFC4C9E00F1F797 /* PKAssembly.m in Sources */ = {isa = PBXBuildFile; fileRef = D34BADA00FF9C9B000D7773A /* PKAssembly.m */; };
D3FDC6F10FFC4C9E00F1F797 /* PKParser.m in Sources */ = {isa = PBXBuildFile; fileRef = D34BADD60FF9CBFB00D7773A /* PKParser.m */; };
Expand Down Expand Up @@ -3777,6 +3777,7 @@
554BD2E916372F81003DA169 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
D33494150E2963FE00406085 /* Build configuration list for PBXNativeTarget "DemoApp" */ = {
isa = XCConfigurationList;
Expand Down
4 changes: 0 additions & 4 deletions src/PKPattern.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@ - (id)initWithString:(NSString *)s options:(PKPatternOptions)opts {


- (BOOL)qualifies:(id)obj {
#if __has_feature(objc_arc)
return FALSE;
#else
PKToken *tok = (PKToken *)obj;

NSRange r = NSMakeRange(0, [tok.stringValue length]);

return NSEqualRanges(r, [tok.stringValue rangeOfRegex:self.string options:(uint32_t)options inRange:r capture:0 error:nil]);
#endif
}

@end
4 changes: 0 additions & 4 deletions src/RegexKitLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if !__has_feature(objc_arc)

#ifdef __OBJC__
#import <Foundation/NSArray.h>
#import <Foundation/NSError.h>
Expand Down Expand Up @@ -220,5 +218,3 @@ extern NSString * const RKLICURegexRegexOptionsErrorKey;
#ifdef __cplusplus
} // extern "C"
#endif

#endif // __has_feature(objc_arc)
2 changes: 0 additions & 2 deletions src/RegexKitLite.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if !__has_feature(objc_arc)

#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFArray.h>
Expand Down Expand Up @@ -1634,4 +1633,3 @@ - (NSUInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex wi

@end

#endif // __has_feature(objc_arc)

0 comments on commit 3f8715b

Please sign in to comment.