summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Profic <kprofic@gmail.com>2013-12-18 14:21:45 +0100
committerKrzysztof Profic <kprofic@gmail.com>2013-12-18 14:21:45 +0100
commit1be9f7c646242baef0c45a8d1a3923362548e3c6 (patch)
treea9f06065838ee803d59527a54196cdbb89bdc28c
parent5a69fcef00599e0412073ebcdb6f3eee44d5f64d (diff)
downloadpygments-1be9f7c646242baef0c45a8d1a3923362548e3c6.tar.gz
Handle also cocoa protocols as keywords
-rw-r--r--pygments/lexers/_cocoabuiltins.py24
-rw-r--r--pygments/lexers/compiled.py6
2 files changed, 19 insertions, 11 deletions
diff --git a/pygments/lexers/_cocoabuiltins.py b/pygments/lexers/_cocoabuiltins.py
index 651a5708..266596f8 100644
--- a/pygments/lexers/_cocoabuiltins.py
+++ b/pygments/lexers/_cocoabuiltins.py
@@ -4,29 +4,37 @@ import re
FRAMEWORKS_PATH = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/'
frameworks = os.listdir(FRAMEWORKS_PATH)
-all_types = set()
+all_interfaces = set()
+all_protocols = set()
for framework in frameworks:
frameworkHeadersDir = FRAMEWORKS_PATH + framework + '/Headers/'
if (not os.path.exists(frameworkHeadersDir)): continue
headerFilenames = os.listdir(frameworkHeadersDir)
- types = set()
+ interfaces = set()
for f in headerFilenames:
if (not f.endswith('.h')): continue
headerFilePath = frameworkHeadersDir + f
content = open(headerFilePath).read()
- res = re.search('(?<=@interface )\w+', content)
- if (res):
- types.add(res.group(0))
- all_types.add(res.group(0))
+ int_res = re.search('(?<=@interface )\w+', content)
+ if (int_res):
+ interfaces.add(int_res.group(0))
+ all_interfaces.add(int_res.group(0))
+ pro_res = re.search('(?<=@protocol )\w+', content)
+ if (pro_res):
+ interfaces.add(pro_res.group(0))
+ all_protocols.add(pro_res.group(0))
print framework + "\n"
# print types
-print "ALL: \n"
-print all_types \ No newline at end of file
+print "ALL interfaces: \n"
+print all_interfaces
+
+print "\nALL protocols: \n"
+print all_protocols \ No newline at end of file
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index 5911f3c1..4db272bb 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -1399,8 +1399,8 @@ def objective(baselexer):
],
}
- # TODO extranct to separate file
- cocoa_types = ['UITableViewCell', 'NSLinguisticTagger', 'NSStream', 'UIPrintInfo', 'SKPaymentTransaction', 'SKPhysicsWorld', 'NSString', 'CMAttitude', 'SKSpriteNode', 'JSContext', 'UICollectionReusableView', 'GKLeaderboard', 'NSFetchedResultsController', 'MKTileOverlayRenderer', 'UIMenuController', 'NSURLSession', 'GLKEffectPropertyLight', 'UIAccessibilityElement', 'NSShadow', 'CAEmitterCell', 'UIPushBehavior', 'CBCharacteristic', 'CBUUID', 'CMStepCounter', 'NSNetService', 'UICollectionView', 'CAShapeLayer', 'MCPeerID', 'NSFileVersion', 'CMGyroData', 'CIFilter', 'UIView', 'MKMapItem', 'PKPass', 'GKMatchRequest', 'AVMetadataObject', 'CLGeocoder', 'NSByteCountFormatter', 'CAEmitterLayer', 'CAAnimation', 'MKOverlayPathView', 'UIActionSheet', 'UIBarItem', 'SKProduct', 'AVAssetExportSession', 'CATextLayer', 'AVAssetTrackSegment', 'GKSession', 'CLCircularRegion', 'MKTileOverlay', 'UICollisionBehavior', 'ACAccountCredential', 'AVMediaSelectionGroup', 'NSIndexSet', 'AVAudioRecorder', 'NSURL', 'CBCentral', 'UITableView', 'GCController', 'GCControllerElement', 'UISwipeGestureRecognizer', 'MKOverlayRenderer', 'MKPolyline', 'EKReminder', 'MKPolylineView', 'UIImagePickerController', 'EKParticipant', 'UIActivityItemProvider', 'CLLocation', 'GKLeaderboardViewController', 'GKNotificationBanner', 'GKScore', 'NSURLConnection', 'ABUnknownPersonViewController', 'SKTextureAtlas', 'NSKeyedArchiver', 'GKLeaderboardSet', 'CBATTRequest', 'MKPolygonRenderer', 'JSValue', 'UIAlertView', 'NSIncrementalStore', 'MFMailComposeViewController', 'SSReadingList', 'SKLabelNode', 'NSManagedObjectContext', 'ACAccount', 'AVMetadataItem', 'CLLocationManager', 'UIStepper', 'UIRefreshControl', 'GKTurnBasedParticipant', 'UICollectionViewTransitionLayout', 'CBCentralManager', 'SLComposeViewController', 'NSHashTable', 'MKUserTrackingBarButtonItem', 'UITabBarController', 'CMMotionActivity', 'SKAction', 'AVPlayerItemOutput', 'UIDocumentInteractionController', 'UILabel', 'NSExpression', 'UIStoryboardSegue', 'NSOrderedSet', 'UIPopoverBackgroundView', 'UIToolbar', 'NSEntityMigrationPolicy', 'NSLocale', 'NSTimeZone', 'UIManagedDocument', 'ALAssetRepresentation', 'NSLayoutManager', 'EKCalendarChooser', 'EKObject', 'CATiledLayer', 'GLKReflectionMapEffect', 'NSManagedObjectID', 'NSUserDefaults', 'SLRequest', 'AVPlayerLayer', 'NSPointerArray', 'AVAudioMix', 'MCAdvertiserAssistant', 'MKMapSnapshotOptions', 'GKMatch', 'AVTimedMetadataGroup', 'UIDynamicItemBehavior', 'NSFetchRequest', 'UIDevice', 'NSManagedObject', 'NKAssetDownload', 'AVOutputSettingsAssistant', 'UITabBar', 'NSFetchRequestExpression', 'CTSubscriber', 'NSPersistentStoreRequest', 'ADBannerView', 'AVPlayerItem', 'AVSynchronizedLayer', 'MKDirectionsRequest', 'CBPeripheralManager', 'UIStoryboardPopoverSegue', 'SKProductsRequest', 'UIGravityBehavior', 'UIWindow', 'UIBezierPath', 'UINavigationController', 'ABPeoplePickerNavigationController', 'EKSource', 'AVAssetWriterInput', 'AVPlayerItemTrack', 'NSURLResponse', 'SKPaymentQueue', 'MKReverseGeocoder', 'GCControllerAxisInput', 'MKMapSnapshotter', 'NSOrthography', 'NSCharacterSet', 'AVAssetReaderOutput', 'CIFeature', 'UICollectionViewController', 'AVAssetTrack', 'SKEmitterNode', 'CTCall', 'CMAccelerometerData', 'CIColor', 'CAGradientLayer', 'NSFormatter', 'CATransaction', 'UIStoryboard', 'MPMediaLibrary', 'UITapGestureRecognizer', 'GKAchievementDescription', 'MCBrowserViewController', 'NSRelationshipDescription', 'NSMutableAttributedString', 'MPNowPlayingInfoCenter', 'MKLocalSearch', 'EAAccessory', 'NSNotificationQueue', 'NSValue', 'SKPhysicsContact', 'NSProgress', 'NSTextCheckingResult', 'NSEntityDescription', 'NSURLCredentialStorage', 'UIApplication', 'SKDownload', 'MKLocalSearchRequest', 'SKScene', 'UISearchDisplayController', 'CAReplicatorLayer', 'UIPrintPageRenderer', 'EKCalendarItem', 'NSUUID', 'EAAccessoryManager', 'AVAssetResourceLoader', 'MyClass', 'NSURLRequest', 'CIVector', 'UINavigationBar', 'UIPanGestureRecognizer', 'MPMediaQuery', 'ABNewPersonViewController', 'ACAccountType', 'MFMessageComposeViewController', 'SKVideoNode', 'MKGeodesicPolyline', 'GCExtendedGamepad', 'CAValueFunction', 'UIActivityIndicatorView', 'NSNotification', 'SKReceiptRefreshRequest', 'NSMapTable', 'NSSet', 'CMMotionManager', 'GKVoiceChatService', 'UIPageControl', 'GCExtendedGamepadSnapshot', 'NSLayoutConstraint', 'UIWebView', 'NSIncrementalStoreNode', 'EKEventStore', 'UISlider', 'AVCaptureInput', 'SKPhysicsBody', 'NSOperation', 'MKMapCamera', 'GLKEffectPropertyMaterial', 'AVCaptureDevice', 'CTCallCenter', 'UIDynamicAnimator', 'UIGestureRecognizer', 'MCNearbyServiceBrowser', 'MPVolumeView', 'MKPolylineRenderer', 'UICollectionViewLayoutAttributes', 'NSValueTransformer', 'NSEntityMapping', 'SKTexture', 'AVAsset', 'NSUndoManager', 'MPMediaPickerController', 'NSFileCoordinator', 'NSFileHandle', 'UISegmentedControl', 'NSManagedObjectModel', 'UITabBarItem', 'MPMediaItem', 'EKRecurrenceRule', 'UIEvent', 'UITouch', 'UIPrintInteractionController', 'CMDeviceMotion', 'NSCompoundPredicate', 'MKMultiPoint', 'UIPrintFormatter', 'SKView', 'UIPopoverController', 'EKEventViewController', 'NSPort', 'MKCircleRenderer', 'AVCompositionTrack', 'UINib', 'NSUbiquitousKeyValueStore', 'UITableViewHeaderFooterView', 'UISplitViewController', 'AVAudioSession', 'NSNull', 'MKCircleView', 'UIColor', 'UIAttachmentBehavior', 'MKCircle', 'GKPlayer', 'NSMappingModel', 'NSHTTPCookie', 'NSAttributeDescription', 'AVPlayer', 'MKAnnotationView', 'UIFontDescriptor', 'NSTimer', 'CBDescriptor', 'MKOverlayView', 'EKEventEditViewController', 'NSSaveChangesRequest', 'UIReferenceLibraryViewController', 'UILocalizedIndexedCollation', 'AVAssetWriter', 'NSBundle', 'SKStoreProductViewController', 'GLKViewController', 'UIActivity', 'MKShape', 'NSMergeConflict', 'CIImage', 'UIRotationGestureRecognizer', 'AVAssetImageGenerator', 'GCControllerButtonInput', 'NSSortDescriptor', 'NKIssue', 'UIScreenMode', 'JSVirtualMachine', 'AVAssetReader', 'NSAttributedString', 'GKMatchmakerViewController', 'UIButton', 'GKLocalPlayer', 'NSJSONSerialization', 'CBPeripheral', 'UIPercentDrivenInteractiveTransition', 'NSEnumerator', 'UIDocument', 'MKLocalSearchResponse', 'CBService', 'MCSession', 'QLPreviewController', 'CAMediaTimingFunction', 'NSNumberFormatter', 'NSMetadataQuery', 'CTCarrier', 'UIAcceleration', 'UIMotionEffect', 'CLHeading', 'NSHTTPCookieStorage', 'MKDirectionsResponse', 'UILocalNotification', 'UITextView', 'CMMagnetometerData', 'UIProgressView', 'UIPinchGestureRecognizer', 'UISearchBar', 'MKPlacemark', 'ALAssetsFilter', 'CAEAGLLayer', 'ABPersonViewController', 'CIDetector', 'GKTurnBasedMatchmakerViewController', 'MPMediaItemCollection', 'NSURLCredential', 'NSAtomicStoreCacheNode', 'EKCalendar', 'NSDictionary', 'MKPolygon', 'MKMapView', 'NSExpressionDescription', 'UIViewController', 'NSURLAuthenticationChallenge', 'MKDistanceFormatter', 'NSPropertyListSerialization', 'GKPeerPickerController', 'UITableViewController', 'MPMoviePlayerController', 'MKPointAnnotation', 'NSCache', 'SKPhysicsJoint', 'NSXMLParser', 'AVCaptureSession', 'AVCaptureVideoPreviewLayer', 'UISnapBehavior', 'UIPageViewController', 'NSTextAttachment', 'NSException', 'CMMotionActivityManager', 'MKUserLocation', 'EAGLContext', 'UIPasteboard', 'ALAsset', 'MPMoviePlayerViewController', 'NSCachedURLResponse', 'ALAssetsLibrary', 'NSInvocation', 'UILongPressGestureRecognizer', 'NSTextStorage', 'MKMapSnapshot', 'GLKEffectPropertyFog', 'AVComposition', 'PKPassLibrary', 'NSLock', 'UIDynamicBehavior', 'AVPlayerMediaSelectionCriteria', 'CALayer', 'UIBarButtonItem', 'CLBeaconRegion', 'SKEffectNode', 'EKRecurrenceEnd', 'NSTextContainer', 'TWTweetComposeViewController', 'UIScrollView', 'EKRecurrenceDayOfWeek', 'ASIdentifierManager', 'UIScreen', 'CLRegion', 'NSProcessInfo', 'GLKTextureInfo', 'NSTextTab', 'JSManagedValue', 'NSDate', 'UITextChecker', 'NSData', 'EKAlarm', 'UIVideoEditorController', 'NSAtomicStore', 'UIResponder', 'AVCompositionTrackSegment', 'GCGamepadSnapshot', 'CAEmitterBehavior', 'GLKSkyboxEffect', 'UISwitch', 'EKStructuredLocation', 'NSProxy', 'GLKBaseEffect', 'NSCoder', 'MPMediaPlaylist', 'EKEvent', 'NSDateFormatter', 'UICollectionViewFlowLayoutInvalidationContext', 'UITextField', 'CLPlacemark', 'AVCaptureOutput', 'NSPropertyDescription', 'GCGamepad', 'NSPersistentStoreCoordinator', 'CIContext', 'NSThread', 'SKRequest', 'NSPredicate', 'GKVoiceChat', 'SKCropNode', 'SKKeyframeSequence', 'NSStringDrawingContext', 'GKGameCenterViewController', 'UIPrintPaper', 'GLKEffectPropertyTransform', 'UIDatePicker', 'MKDirections', 'ALAssetsGroup', 'SKTransition', 'UIFont', 'MKPinAnnotationView', 'UIPickerView', 'UIImageView', 'SKNode', 'MPMediaQuerySection', 'GKFriendRequestComposeViewController', 'NSError', 'CTSubscriberInfo', 'CMLogItem', 'NSAutoreleasePool', 'AVSpeechSynthesisVoice', 'UIImage', 'NSDecimalNumber', 'AVAssetTrackGroup', 'GKChallengeEventHandler', 'UIControl', 'SKPayment', 'ADInterstitialAd', 'GLKEffectPropertyTexture', 'NSArray', 'GCControllerDirectionPad', 'NSFileManager', 'CAScrollLayer', 'UIScreenEdgePanGestureRecognizer', 'EASession', 'UIInputView', 'NSFileWrapper', 'NSPointerFunctions', 'NSRunLoop', 'NSMigrationManager', 'GLKEffectProperty', 'SKShapeNode', 'MKPolygonView', 'NSScanner', 'AVAudioPlayer', 'AVVideoComposition', 'NKLibrary', 'NSPersistentStore', 'NSPropertyMapping', 'GKChallenge', 'NSURLProtectionSpace', 'ACAccountStore', 'NSComparisonPredicate', 'PKAddPassesViewController', 'CTTelephonyNetworkInfo', 'AVTextStyleRule', 'NSFetchedPropertyDescription', 'CATransformLayer', 'MCNearbyServiceAdvertiser', 'NSObject', 'MPMusicPlayerController', 'MKOverlayPathRenderer', 'GKAchievement', 'MPMediaEntity', 'TWRequest', 'MIDINetworkHost', 'NSIndexPath', 'AVVideoCompositionRenderContext', 'CADisplayLink', 'GLKView', 'UIActivityViewController', 'GKAchievementViewController', 'NSURLProtocol', 'NSCalendar', 'NSMethodSignature', 'NSRegularExpression', 'EAGLSharegroup', 'UIDictationPhrase']
+ cocoa_interfaces = ['UITableViewCell', 'NSLinguisticTagger', 'NSStream', 'UIPrintInfo', 'SKPaymentTransaction', 'SKPhysicsWorld', 'NSString', 'CMAttitude', 'SKSpriteNode', 'JSContext', 'UICollectionReusableView', 'GKLeaderboard', 'NSFetchedResultsController', 'MKTileOverlayRenderer', 'UIMenuController', 'NSURLSession', 'GLKEffectPropertyLight', 'UIAccessibilityElement', 'NSShadow', 'CAEmitterCell', 'UIPushBehavior', 'CBCharacteristic', 'CBUUID', 'CMStepCounter', 'NSNetService', 'UICollectionView', 'CAShapeLayer', 'MCPeerID', 'NSFileVersion', 'CMGyroData', 'CIFilter', 'UIView', 'MKMapItem', 'PKPass', 'GKMatchRequest', 'AVMetadataObject', 'CLGeocoder', 'NSByteCountFormatter', 'CAEmitterLayer', 'CAAnimation', 'MKOverlayPathView', 'UIActionSheet', 'UIBarItem', 'SKProduct', 'AVAssetExportSession', 'CATextLayer', 'AVAssetTrackSegment', 'GKSession', 'CLCircularRegion', 'MKTileOverlay', 'UICollisionBehavior', 'ACAccountCredential', 'AVMediaSelectionGroup', 'NSIndexSet', 'AVAudioRecorder', 'NSURL', 'CBCentral', 'UITableView', 'GCController', 'GCControllerElement', 'UISwipeGestureRecognizer', 'MKOverlayRenderer', 'MKPolyline', 'EKReminder', 'MKPolylineView', 'UIImagePickerController', 'EKParticipant', 'UIActivityItemProvider', 'CLLocation', 'GKLeaderboardViewController', 'GKNotificationBanner', 'GKScore', 'NSURLConnection', 'ABUnknownPersonViewController', 'SKTextureAtlas', 'NSKeyedArchiver', 'GKLeaderboardSet', 'CBATTRequest', 'MKPolygonRenderer', 'JSValue', 'UIAlertView', 'NSIncrementalStore', 'MFMailComposeViewController', 'SSReadingList', 'SKLabelNode', 'NSManagedObjectContext', 'ACAccount', 'AVMetadataItem', 'CLLocationManager', 'UIStepper', 'UIRefreshControl', 'GKTurnBasedParticipant', 'UICollectionViewTransitionLayout', 'CBCentralManager', 'SLComposeViewController', 'NSHashTable', 'MKUserTrackingBarButtonItem', 'UITabBarController', 'CMMotionActivity', 'SKAction', 'AVPlayerItemOutput', 'UIDocumentInteractionController', 'UILabel', 'NSExpression', 'UIStoryboardSegue', 'NSOrderedSet', 'UIPopoverBackgroundView', 'UIToolbar', 'NSEntityMigrationPolicy', 'NSLocale', 'NSTimeZone', 'UIManagedDocument', 'ALAssetRepresentation', 'NSLayoutManager', 'EKCalendarChooser', 'EKObject', 'CATiledLayer', 'GLKReflectionMapEffect', 'NSManagedObjectID', 'NSUserDefaults', 'SLRequest', 'AVPlayerLayer', 'NSPointerArray', 'AVAudioMix', 'MCAdvertiserAssistant', 'MKMapSnapshotOptions', 'GKMatch', 'AVTimedMetadataGroup', 'UIDynamicItemBehavior', 'NSFetchRequest', 'UIDevice', 'NSManagedObject', 'NKAssetDownload', 'AVOutputSettingsAssistant', 'UITabBar', 'NSFetchRequestExpression', 'CTSubscriber', 'NSPersistentStoreRequest', 'ADBannerView', 'AVPlayerItem', 'AVSynchronizedLayer', 'MKDirectionsRequest', 'CBPeripheralManager', 'UIStoryboardPopoverSegue', 'SKProductsRequest', 'UIGravityBehavior', 'UIWindow', 'UIBezierPath', 'UINavigationController', 'ABPeoplePickerNavigationController', 'EKSource', 'AVAssetWriterInput', 'AVPlayerItemTrack', 'NSURLResponse', 'SKPaymentQueue', 'MKReverseGeocoder', 'GCControllerAxisInput', 'MKMapSnapshotter', 'NSOrthography', 'NSCharacterSet', 'AVAssetReaderOutput', 'CIFeature', 'UICollectionViewController', 'AVAssetTrack', 'SKEmitterNode', 'CTCall', 'CMAccelerometerData', 'CIColor', 'CAGradientLayer', 'NSFormatter', 'CATransaction', 'UIStoryboard', 'MPMediaLibrary', 'UITapGestureRecognizer', 'GKAchievementDescription', 'MCBrowserViewController', 'NSRelationshipDescription', 'NSMutableAttributedString', 'MPNowPlayingInfoCenter', 'MKLocalSearch', 'EAAccessory', 'NSNotificationQueue', 'NSValue', 'SKPhysicsContact', 'NSProgress', 'NSTextCheckingResult', 'NSEntityDescription', 'NSURLCredentialStorage', 'UIApplication', 'SKDownload', 'MKLocalSearchRequest', 'SKScene', 'UISearchDisplayController', 'CAReplicatorLayer', 'UIPrintPageRenderer', 'EKCalendarItem', 'NSUUID', 'EAAccessoryManager', 'AVAssetResourceLoader', 'MyClass', 'NSURLRequest', 'CIVector', 'UINavigationBar', 'UIPanGestureRecognizer', 'MPMediaQuery', 'ABNewPersonViewController', 'ACAccountType', 'MFMessageComposeViewController', 'SKVideoNode', 'MKGeodesicPolyline', 'GCExtendedGamepad', 'CAValueFunction', 'UIActivityIndicatorView', 'NSNotification', 'SKReceiptRefreshRequest', 'NSMapTable', 'NSSet', 'CMMotionManager', 'GKVoiceChatService', 'UIPageControl', 'GCExtendedGamepadSnapshot', 'NSLayoutConstraint', 'UIWebView', 'NSIncrementalStoreNode', 'EKEventStore', 'UISlider', 'AVCaptureInput', 'SKPhysicsBody', 'NSOperation', 'MKMapCamera', 'GLKEffectPropertyMaterial', 'AVCaptureDevice', 'CTCallCenter', 'UIDynamicAnimator', 'UIGestureRecognizer', 'MCNearbyServiceBrowser', 'MPVolumeView', 'MKPolylineRenderer', 'UICollectionViewLayoutAttributes', 'NSValueTransformer', 'NSEntityMapping', 'SKTexture', 'AVAsset', 'NSUndoManager', 'MPMediaPickerController', 'NSFileCoordinator', 'NSFileHandle', 'UISegmentedControl', 'NSManagedObjectModel', 'UITabBarItem', 'MPMediaItem', 'EKRecurrenceRule', 'UIEvent', 'UITouch', 'UIPrintInteractionController', 'CMDeviceMotion', 'NSCompoundPredicate', 'MKMultiPoint', 'UIPrintFormatter', 'SKView', 'UIPopoverController', 'EKEventViewController', 'NSPort', 'MKCircleRenderer', 'AVCompositionTrack', 'UINib', 'NSUbiquitousKeyValueStore', 'UITableViewHeaderFooterView', 'UISplitViewController', 'AVAudioSession', 'NSNull', 'MKCircleView', 'UIColor', 'UIAttachmentBehavior', 'MKCircle', 'GKPlayer', 'NSMappingModel', 'NSHTTPCookie', 'NSAttributeDescription', 'AVPlayer', 'MKAnnotationView', 'UIFontDescriptor', 'NSTimer', 'CBDescriptor', 'MKOverlayView', 'EKEventEditViewController', 'NSSaveChangesRequest', 'UIReferenceLibraryViewController', 'UILocalizedIndexedCollation', 'AVAssetWriter', 'NSBundle', 'SKStoreProductViewController', 'GLKViewController', 'UIActivity', 'MKShape', 'NSMergeConflict', 'CIImage', 'UIRotationGestureRecognizer', 'AVAssetImageGenerator', 'GCControllerButtonInput', 'NSSortDescriptor', 'NKIssue', 'UIScreenMode', 'JSVirtualMachine', 'AVAssetReader', 'NSAttributedString', 'GKMatchmakerViewController', 'UIButton', 'GKLocalPlayer', 'NSJSONSerialization', 'CBPeripheral', 'UIPercentDrivenInteractiveTransition', 'NSEnumerator', 'UIDocument', 'MKLocalSearchResponse', 'CBService', 'MCSession', 'QLPreviewController', 'CAMediaTimingFunction', 'NSNumberFormatter', 'NSMetadataQuery', 'CTCarrier', 'UIAcceleration', 'UIMotionEffect', 'CLHeading', 'NSHTTPCookieStorage', 'MKDirectionsResponse', 'UILocalNotification', 'UITextView', 'CMMagnetometerData', 'UIProgressView', 'UIPinchGestureRecognizer', 'UISearchBar', 'MKPlacemark', 'ALAssetsFilter', 'CAEAGLLayer', 'ABPersonViewController', 'CIDetector', 'GKTurnBasedMatchmakerViewController', 'MPMediaItemCollection', 'NSURLCredential', 'NSAtomicStoreCacheNode', 'EKCalendar', 'NSDictionary', 'MKPolygon', 'MKMapView', 'NSExpressionDescription', 'UIViewController', 'NSURLAuthenticationChallenge', 'MKDistanceFormatter', 'NSPropertyListSerialization', 'GKPeerPickerController', 'UITableViewController', 'MPMoviePlayerController', 'MKPointAnnotation', 'NSCache', 'SKPhysicsJoint', 'NSXMLParser', 'AVCaptureSession', 'AVCaptureVideoPreviewLayer', 'UISnapBehavior', 'UIPageViewController', 'NSTextAttachment', 'NSException', 'CMMotionActivityManager', 'MKUserLocation', 'EAGLContext', 'UIPasteboard', 'ALAsset', 'MPMoviePlayerViewController', 'NSCachedURLResponse', 'ALAssetsLibrary', 'NSInvocation', 'UILongPressGestureRecognizer', 'NSTextStorage', 'MKMapSnapshot', 'GLKEffectPropertyFog', 'AVComposition', 'PKPassLibrary', 'NSLock', 'UIDynamicBehavior', 'AVPlayerMediaSelectionCriteria', 'CALayer', 'UIBarButtonItem', 'CLBeaconRegion', 'SKEffectNode', 'EKRecurrenceEnd', 'NSTextContainer', 'TWTweetComposeViewController', 'UIScrollView', 'EKRecurrenceDayOfWeek', 'ASIdentifierManager', 'UIScreen', 'CLRegion', 'NSProcessInfo', 'GLKTextureInfo', 'NSTextTab', 'JSManagedValue', 'NSDate', 'UITextChecker', 'NSData', 'EKAlarm', 'UIVideoEditorController', 'NSAtomicStore', 'UIResponder', 'AVCompositionTrackSegment', 'GCGamepadSnapshot', 'CAEmitterBehavior', 'GLKSkyboxEffect', 'UISwitch', 'EKStructuredLocation', 'NSProxy', 'GLKBaseEffect', 'NSCoder', 'MPMediaPlaylist', 'EKEvent', 'NSDateFormatter', 'UICollectionViewFlowLayoutInvalidationContext', 'UITextField', 'CLPlacemark', 'AVCaptureOutput', 'NSPropertyDescription', 'GCGamepad', 'NSPersistentStoreCoordinator', 'CIContext', 'NSThread', 'SKRequest', 'NSPredicate', 'GKVoiceChat', 'SKCropNode', 'SKKeyframeSequence', 'NSStringDrawingContext', 'GKGameCenterViewController', 'UIPrintPaper', 'GLKEffectPropertyTransform', 'UIDatePicker', 'MKDirections', 'ALAssetsGroup', 'SKTransition', 'UIFont', 'MKPinAnnotationView', 'UIPickerView', 'UIImageView', 'SKNode', 'MPMediaQuerySection', 'GKFriendRequestComposeViewController', 'NSError', 'CTSubscriberInfo', 'CMLogItem', 'NSAutoreleasePool', 'AVSpeechSynthesisVoice', 'UIImage', 'NSDecimalNumber', 'AVAssetTrackGroup', 'GKChallengeEventHandler', 'UIControl', 'SKPayment', 'ADInterstitialAd', 'GLKEffectPropertyTexture', 'NSArray', 'GCControllerDirectionPad', 'NSFileManager', 'CAScrollLayer', 'UIScreenEdgePanGestureRecognizer', 'EASession', 'UIInputView', 'NSFileWrapper', 'NSPointerFunctions', 'NSRunLoop', 'NSMigrationManager', 'GLKEffectProperty', 'SKShapeNode', 'MKPolygonView', 'NSScanner', 'AVAudioPlayer', 'AVVideoComposition', 'NKLibrary', 'NSPersistentStore', 'NSPropertyMapping', 'GKChallenge', 'NSURLProtectionSpace', 'ACAccountStore', 'NSComparisonPredicate', 'PKAddPassesViewController', 'CTTelephonyNetworkInfo', 'AVTextStyleRule', 'NSFetchedPropertyDescription', 'CATransformLayer', 'MCNearbyServiceAdvertiser', 'NSObject', 'MPMusicPlayerController', 'MKOverlayPathRenderer', 'GKAchievement', 'MPMediaEntity', 'TWRequest', 'MIDINetworkHost', 'NSIndexPath', 'AVVideoCompositionRenderContext', 'CADisplayLink', 'GLKView', 'UIActivityViewController', 'GKAchievementViewController', 'NSURLProtocol', 'NSCalendar', 'NSMethodSignature', 'NSRegularExpression', 'EAGLSharegroup', 'UIDictationPhrase']
+ cocoa_protocols = ['SKStoreProductViewControllerDelegate', 'AVVideoCompositionInstruction', 'AVAudioSessionDelegate', 'GKMatchDelegate', 'NSFileManagerDelegate', 'UILayoutSupport', 'NSCopying', 'UIPrintInteractionControllerDelegate', 'SKProductsRequestDelegate', 'NSTextStorageDelegate', 'MCBrowserViewControllerDelegate', 'UIViewControllerTransitionCoordinatorContext', 'NSTextAttachmentContainer', 'NSDecimalNumberBehaviors', 'UIViewControllerTransitioningDelegate', 'UIAlertViewDelegate', 'AVAudioPlayerDelegate', 'MKReverseGeocoderDelegate', 'GKFriendRequestComposeViewControllerDelegate', 'UIActivityItemSource', 'GLKViewControllerDelegate', 'GKAchievementViewControllerDelegate', 'EKEventEditViewDelegate', 'NSURLConnectionDelegate', 'GKPeerPickerControllerDelegate', 'UIGuidedAccessRestrictionDelegate', 'AVSpeechSynthesizerDelegate', 'MFMailComposeViewControllerDelegate', 'ADInterstitialAdDelegate', 'AVAssetResourceLoaderDelegate', 'UITabBarControllerDelegate', 'SKPaymentTransactionObserver', 'UISplitViewControllerDelegate', 'UIInputViewAudioFeedback', 'GKChallengeListener', 'UIWebViewDelegate', 'UIApplicationDelegate', 'GKInviteEventListener', 'MPMediaPlayback', 'MyClassJavaScriptMethods', 'AVAsynchronousKeyValueLoading', 'QLPreviewItem', 'NSPortDelegate', 'SKRequestDelegate', 'UIImagePickerControllerDelegate', 'UIToolbarDelegate', 'MKOverlay', 'CBCentralManagerDelegate', 'UIPickerViewDataSource', 'UITextInputTraits', 'NSLayoutManagerDelegate', 'NSFetchedResultsControllerDelegate', 'ABPeoplePickerNavigationControllerDelegate', 'UITextFieldDelegate', 'GKGameCenterControllerDelegate', 'MPMediaPickerControllerDelegate', 'UIPickerViewAccessibilityDelegate', 'ADBannerViewDelegate', 'NSURLSessionDelegate', 'NSXMLParserDelegate', 'UIViewControllerRestoration', 'UISearchBarDelegate', 'UIBarPositioning', 'SKPhysicsContactDelegate', 'CAAction', 'PKAddPassesViewControllerDelegate', 'MCNearbyServiceAdvertiserDelegate', 'GKTurnBasedMatchmakerViewControllerDelegate', 'UIActionSheetDelegate', 'AVCaptureVideoDataOutputSampleBufferDelegate', 'UIAppearanceContainer', 'NSFilePresenter', 'UIViewControllerContextTransitioning', 'CBPeripheralManagerDelegate', 'NSFastEnumeration', 'NSURLAuthenticationChallengeSender', 'AVVideoCompositing', 'CIFilterConstructor', 'GKLocalPlayerListener', 'GLKNamedEffect', 'UIPopoverControllerDelegate', 'MFMessageComposeViewControllerDelegate', 'NSURLProtocolClient', 'UIVideoEditorControllerDelegate', 'UITableViewDataSource', 'UIDynamicAnimatorDelegate', 'EKCalendarChooserDelegate', 'UICollisionBehaviorDelegate', 'NSStreamDelegate', 'MCNearbyServiceBrowserDelegate', 'UINavigationControllerDelegate', 'MCSessionDelegate', 'GKTurnBasedEventListener', 'GLKViewDelegate', 'EAAccessoryDelegate', 'ABPersonViewControllerDelegate', 'EKEventViewDelegate', 'UIScrollViewDelegate', 'CBPeripheralDelegate', 'UIGestureRecognizerDelegate', 'UINavigationBarDelegate', 'UIDocumentInteractionControllerDelegate', 'UIAccessibilityReadingContent', 'ABUnknownPersonViewControllerDelegate', 'NSCacheDelegate', 'UICollectionViewDelegateFlowLayout', 'MKAnnotation', 'UIAccessibilityIdentification', 'ABNewPersonViewControllerDelegate', 'CAMediaTiming', 'UITextViewDelegate', 'UITabBarDelegate', 'GKLeaderboardViewControllerDelegate', 'MKMapViewDelegate', 'UIKeyInput', 'UICollectionViewDataSource', 'NSLocking', 'GKChallengeEventHandlerDelegate', 'MCAdvertiserAssistantDelegate', 'AVPlayerItemOutputPullDelegate', 'EAGLDrawable', 'AVVideoCompositionValidationHandling', 'UIAccelerometerDelegate', 'UIPageViewControllerDelegate', 'AVAudioRecorderDelegate', 'GKSessionDelegate', 'NSKeyedArchiverDelegate', 'UIDynamicItem', 'CLLocationManagerDelegate', 'NSMetadataQueryDelegate', 'NSNetServiceDelegate', 'GKMatchmakerViewControllerDelegate']
def analyse_text(text):
if _oc_keywords.search(text):
@@ -1415,7 +1415,7 @@ def objective(baselexer):
for index, token, value in \
baselexer.get_tokens_unprocessed(self, text):
if token is Name:
- if value in self.cocoa_types:
+ if value in self.cocoa_interfaces or value in self.cocoa_protocols:
token = Name.Builtin.Pseudo # TODO new token type
yield index, token, value