Something went wrong. Try again.
Kieran's opinionated (and probably slightly dumb) nix config
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484================================================================================Class interface with superclass, protocols and ivars================================================================================@interface Shape : NSObject <Drawable, NSCopying> { NSInteger _sides;@private void *_opaque;}@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) superclass: (type_identifier) protocols: (objc_protocol_reference_list protocol: (type_identifier) protocol: (type_identifier)) ivars: (objc_instance_variables (field_declaration type: (type_identifier) declarator: (field_identifier)) (objc_visibility_specifier) (field_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (field_identifier))))))================================================================================Category and class extension================================================================================@interface Shape (Debug)@end@interface Shape ()@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) category: (objc_category name: (identifier))) (objc_class_interface name: (type_identifier) category: (objc_category)))================================================================================Lightweight generics on a class declaration================================================================================@interface Box<__covariant T> : NSObject@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) type_parameters: (objc_type_parameter_list parameter: (objc_type_parameter name: (type_identifier))) superclass: (type_identifier)))================================================================================Protocol declaration with required and optional sections================================================================================@protocol Drawable <NSObject>@required- (void)draw;@optional- (BOOL)wantsRedraw;@end--------------------------------------------------------------------------------(translation_unit (objc_protocol_declaration name: (type_identifier) protocols: (objc_protocol_reference_list protocol: (type_identifier)) body: (objc_availability_specifier) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector name: (identifier))) body: (objc_availability_specifier) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (type_identifier))) selector: (objc_method_selector name: (identifier)))))================================================================================Forward declarations, alias and module import================================================================================@class Renderer, Shape;@protocol Drawable;@compatibility_alias NewName OldName;@import Foundation.NSString;--------------------------------------------------------------------------------(translation_unit (objc_class_forward_declaration name: (type_identifier) name: (type_identifier)) (objc_protocol_forward_declaration name: (type_identifier)) (objc_compatibility_alias alias: (type_identifier) name: (type_identifier)) (objc_module_import module: (identifier) module: (identifier)))================================================================================Method declarations with keyword parameters and a variadic tail================================================================================@interface A+ (instancetype)shapeWithSides:(NSInteger)sides;- (void)moveTo:(CGPoint)point animated:(BOOL)animated;- (void)log:(NSString *)fmt, ...;@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (objc_builtin_type))) selector: (objc_method_selector parameter: (objc_method_parameter keyword: (identifier) type: (objc_method_type (type_descriptor type: (type_identifier))) name: (identifier)))) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector parameter: (objc_method_parameter keyword: (identifier) type: (objc_method_type (type_descriptor type: (type_identifier))) name: (identifier)) parameter: (objc_method_parameter keyword: (identifier) type: (objc_method_type (type_descriptor type: (type_identifier))) name: (identifier)))) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector parameter: (objc_method_parameter keyword: (identifier) type: (objc_method_type (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator))) name: (identifier))))))================================================================================Nullability and direction qualifiers on a method type================================================================================@interface A- (nullable id<NSCopying>)copyWithZone:(nullable NSZone *)zone;- (void)send:(in NSString *)text;@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (objc_method_type_qualifier) (type_descriptor type: (template_type name: (type_identifier) arguments: (template_argument_list (type_descriptor type: (type_identifier)))))) selector: (objc_method_selector parameter: (objc_method_parameter keyword: (identifier) type: (objc_method_type (objc_method_type_qualifier) (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator))) name: (identifier)))) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector parameter: (objc_method_parameter keyword: (identifier) type: (objc_method_type (objc_method_type_qualifier) (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator))) name: (identifier))))))================================================================================Properties with attributes, accessors, synthesize and dynamic================================================================================@interface A@property (nonatomic, copy, nullable) NSString *name;@property (nonatomic, assign, getter=isFilled, setter=setFilled:) BOOL filled;@end@implementation A@synthesize name = _name, other;@dynamic filled;@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (objc_property_declaration attributes: (objc_property_attribute_list attribute: (objc_property_attribute) attribute: (objc_property_attribute) attribute: (objc_property_attribute)) type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) body: (objc_property_declaration attributes: (objc_property_attribute_list attribute: (objc_property_attribute) attribute: (objc_property_attribute) attribute: (objc_property_attribute value: (identifier)) attribute: (objc_property_attribute value: (identifier))) type: (type_identifier) declarator: (identifier))) (objc_class_implementation name: (type_identifier) body: (objc_property_synthesize property: (identifier) ivar: (identifier) property: (identifier)) body: (objc_property_dynamic property: (identifier))))================================================================================Message expressions: nesting, super, class receiver and variadic arguments================================================================================@implementation A- (void)f { id x = [[self alloc] init]; [super viewDidLoad]; [NSString stringWithFormat:@"%@ %@", a, b]; [dict setObject:v forKey:@"k"];}@end--------------------------------------------------------------------------------(translation_unit (objc_class_implementation name: (type_identifier) body: (objc_method_definition scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector name: (identifier)) body: (compound_statement (declaration type: (type_identifier) declarator: (init_declarator declarator: (identifier) value: (message_expression receiver: (message_expression receiver: (identifier) selector: (objc_message_selector name: (identifier))) selector: (objc_message_selector name: (identifier))))) (expression_statement (message_expression receiver: (objc_super) selector: (objc_message_selector name: (identifier)))) (expression_statement (message_expression receiver: (identifier) selector: (objc_message_selector argument: (objc_message_argument keyword: (identifier) value: (objc_string_literal value: (string_literal (string_content)))) variadic_argument: (identifier) variadic_argument: (identifier)))) (expression_statement (message_expression receiver: (identifier) selector: (objc_message_selector argument: (objc_message_argument keyword: (identifier) value: (identifier)) argument: (objc_message_argument keyword: (identifier) value: (objc_string_literal value: (string_literal (string_content)))))))))))================================================================================A message send is not a subscript and not a lambda capture================================================================================void f() { a = obj[0]; b = [obj length]; c = [x](int n) { return n; };}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) indices: (subscript_argument_list (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (message_expression receiver: (identifier) selector: (objc_message_selector name: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (lambda_expression captures: (lambda_capture_specifier (identifier)) declarator: (abstract_function_declarator parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (return_statement (identifier)))))))))================================================================================Block literals and block pointer declarators================================================================================void f() { void (^completion)(NSError *error) = ^(NSError *e) { g(e); }; run(^{ h(); }); q(^BOOL(id a) { return YES; });}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (declaration type: (primitive_type) declarator: (init_declarator declarator: (function_declarator declarator: (parenthesized_declarator (block_pointer_declarator declarator: (identifier))) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) value: (block_expression parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier)))) body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (block_expression body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (block_expression return_type: (objc_block_return_type type: (type_identifier)) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier))) body: (compound_statement (return_statement (identifier))))))))))================================================================================Boxed literals================================================================================void f() { a = @"text"; b = @42; c = @YES; d = @(x + 1); e = @[one, two]; g = @{@"k": @1, key: value};}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (objc_string_literal value: (string_literal (string_content))))) (expression_statement (assignment_expression left: (identifier) right: (objc_boxed_expression value: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (objc_boxed_expression value: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (objc_boxed_expression value: (binary_expression left: (identifier) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (objc_array_literal element: (identifier) element: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (objc_dictionary_literal entry: (objc_dictionary_entry key: (objc_string_literal value: (string_literal (string_content))) value: (objc_boxed_expression value: (number_literal))) entry: (objc_dictionary_entry key: (identifier) value: (identifier))))))))================================================================================Reflection expressions================================================================================void f() { a = @selector(tableView:didSelectRowAtIndexPath:); b = @selector(reload); c = @protocol(Drawable); d = @encode(int); if (@available(iOS 13.0, *)) { g(); }}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (objc_selector_expression selector: (objc_selector_name (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (objc_selector_expression selector: (objc_selector_name (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (objc_protocol_expression name: (type_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (objc_encode_expression type: (type_descriptor type: (primitive_type))))) (if_statement condition: (condition_clause value: (objc_available_expression platform: (objc_platform_version platform: (identifier) version: (number_literal)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))))================================================================================Exception handling, synchronization and autorelease pools================================================================================void f() { @autoreleasepool { @try { g(); } @catch (NSException *e) { h(e); } @finally { cleanup(); } } @synchronized (self) { i(); } @throw ex;}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (objc_autoreleasepool_statement body: (compound_statement (objc_try_statement body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list)))) handler: (objc_catch_clause parameter: (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) finalizer: (objc_finally_clause body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list)))))))) (objc_synchronized_statement object: (identifier) body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))))) (objc_throw_statement value: (identifier)))))================================================================================Fast enumeration================================================================================void f() { for (NSString *tag in tags) { g(tag); } for (id x in xs) { h(x); }}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (objc_for_in_statement type: (type_identifier) declarator: (pointer_declarator declarator: (identifier)) collection: (identifier) body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (objc_for_in_statement type: (type_identifier) declarator: (identifier) collection: (identifier) body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))))))================================================================================Protocol qualifiers read as lightweight generics================================================================================@interface A@property (nonatomic, strong) NSArray<NSString *> *tags;@property (nonatomic, weak) id<Drawable> delegate;@property (nonatomic, strong) NSObject<NSCopying> *thing;@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (objc_property_declaration attributes: (objc_property_attribute_list attribute: (objc_property_attribute) attribute: (objc_property_attribute)) type: (template_type name: (type_identifier) arguments: (template_argument_list (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)))) declarator: (pointer_declarator declarator: (identifier))) body: (objc_property_declaration attributes: (objc_property_attribute_list attribute: (objc_property_attribute) attribute: (objc_property_attribute)) type: (template_type name: (type_identifier) arguments: (template_argument_list (type_descriptor type: (type_identifier)))) declarator: (identifier)) body: (objc_property_declaration attributes: (objc_property_attribute_list attribute: (objc_property_attribute) attribute: (objc_property_attribute)) type: (template_type name: (type_identifier) arguments: (template_argument_list (type_descriptor type: (type_identifier)))) declarator: (pointer_declarator declarator: (identifier)))))================================================================================The weak/strong dance needs typeof in a type position================================================================================void f() { __weak typeof(self) weakSelf = self; __strong __typeof__(weakSelf) strongSelf = weakSelf;}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (declaration (type_qualifier) type: (objc_typeof_specifier value: (identifier)) declarator: (init_declarator declarator: (identifier) value: (identifier))) (declaration (type_qualifier) type: (objc_typeof_specifier value: (identifier)) declarator: (init_declarator declarator: (identifier) value: (identifier))))))================================================================================C++ constructs still parse in the same file================================================================================#include <vector>void f() { std::vector<int> v{1, 2, 3}; auto twice = [&v](int x) { return x * 2; }; for (auto &i : v) { i = twice(i); }}--------------------------------------------------------------------------------(translation_unit (preproc_include path: (system_lib_string)) (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (declaration type: (qualified_identifier scope: (namespace_identifier) name: (template_type name: (type_identifier) arguments: (template_argument_list (type_descriptor type: (primitive_type))))) declarator: (init_declarator declarator: (identifier) value: (initializer_list (number_literal) (number_literal) (number_literal)))) (declaration type: (placeholder_type_specifier (auto)) declarator: (init_declarator declarator: (identifier) value: (lambda_expression captures: (lambda_capture_specifier (identifier)) declarator: (abstract_function_declarator parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (return_statement (binary_expression left: (identifier) right: (number_literal))))))) (for_range_loop type: (placeholder_type_specifier (auto)) declarator: (reference_declarator (identifier)) right: (identifier) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))))))))================================================================================Unexpanded macros stand in for declarations================================================================================NS_ASSUME_NONNULL_BEGIN@class GKPlayer;NS_ASSUME_NONNULL_ENDCG_EXTERN void CGDraw(void);--------------------------------------------------------------------------------(translation_unit (objc_macro_invocation name: (objc_macro_name)) (objc_class_forward_declaration name: (type_identifier)) (objc_macro_invocation name: (objc_macro_name)) (objc_macro_invocation name: (objc_macro_name)) (declaration type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type))))))================================================================================Macro with arguments after a method declaration================================================================================@interface A- (void)f API_AVAILABLE(macos(10.9));@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector name: (identifier)) (objc_macro_invocation name: (objc_macro_name) arguments: (objc_macro_arguments (objc_macro_argument_text))))))================================================================================Apple enum macros================================================================================typedef NS_ENUM(NSInteger, Unit) { UnitDay = 0, UnitWeek,};typedef NS_OPTIONS(NSUInteger, Usage) { UsageRead = 1 << 0,};--------------------------------------------------------------------------------(translation_unit (objc_enum_definition type: (objc_enum_specifier macro: (objc_enum_macro_name) backing_type: (type_descriptor type: (type_identifier)) name: (type_identifier) body: (enumerator_list (enumerator name: (identifier) value: (number_literal)) (enumerator name: (identifier))))) (objc_enum_definition type: (objc_enum_specifier macro: (objc_enum_macro_name) backing_type: (type_descriptor type: (type_identifier)) name: (type_identifier) body: (enumerator_list (enumerator name: (identifier) value: (binary_expression left: (number_literal) right: (number_literal)))))))================================================================================A doubled bracket opens a nested message, not a C++ attribute================================================================================void f() { [[NSRunLoop mainRunLoop] runMode:mode beforeDate:date];}[[deprecated]] void g(void);--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (expression_statement (message_expression receiver: (message_expression receiver: (identifier) selector: (objc_message_selector name: (identifier))) selector: (objc_message_selector argument: (objc_message_argument keyword: (identifier) value: (identifier)) argument: (objc_message_argument keyword: (identifier) value: (identifier))))))) (declaration (attribute_declaration (attribute name: (identifier))) type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type))))))================================================================================Class declarations survive a preprocessor guard================================================================================#if TARGET_OS_MAC@implementation Wrapper@end#endif--------------------------------------------------------------------------------(translation_unit (preproc_if condition: (identifier) (objc_class_implementation name: (type_identifier))))================================================================================Preprocessor guards inside a class body================================================================================@interface A#if TARGET_OS_IPHONE@property (nonatomic) NSInteger count;#else- (void)desktopOnly;#endif@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (preproc_if condition: (identifier) (objc_property_declaration attributes: (objc_property_attribute_list attribute: (objc_property_attribute)) type: (type_identifier) declarator: (identifier)) alternative: (preproc_else (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector name: (identifier)))))))================================================================================A macro may stand in for override, and may carry a vendor prefix================================================================================class Impl : public Base{ virtual void SetLabel(const wxString& title) wxOVERRIDE; ~Impl() wxOVERRIDE;};wxBEGIN_EVENT_TABLE(wxWebViewWebKit, wxControl)wxEND_EVENT_TABLE()--------------------------------------------------------------------------------(translation_unit (class_specifier name: (type_identifier) (base_class_clause (access_specifier) (type_identifier)) body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (function_declarator declarator: (field_identifier) parameters: (parameter_list (parameter_declaration (type_qualifier) type: (type_identifier) declarator: (reference_declarator (identifier)))) (objc_macro_name))) (declaration declarator: (function_declarator declarator: (destructor_name (identifier)) parameters: (parameter_list) (objc_macro_name))))) (objc_macro_invocation name: (objc_macro_name) arguments: (objc_macro_arguments (objc_macro_argument_text))) (objc_macro_invocation name: (objc_macro_name) arguments: (objc_macro_arguments)))================================================================================Macro arguments that are not C expressions================================================================================@interface A+ (instancetype)activeWithStatus:(NSError *)e NS_SWIFT_NAME(active(status:));RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder:(NSCoder *)aDecoder)@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (objc_builtin_type))) selector: (objc_method_selector parameter: (objc_method_parameter keyword: (identifier) type: (objc_method_type (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator))) name: (identifier))) (objc_macro_invocation name: (objc_macro_name) arguments: (objc_macro_arguments (objc_macro_argument_text)))) body: (objc_macro_invocation name: (objc_macro_name) arguments: (objc_macro_arguments (objc_macro_argument_text)))))================================================================================A macro may appear among property attributes================================================================================@interface A@property(readonly, nullable, retain, NS_NONATOMIC_IOSONLY) NSString *playerID;@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (objc_property_declaration attributes: (objc_property_attribute_list attribute: (objc_property_attribute) attribute: (objc_property_attribute) attribute: (objc_property_attribute) attribute: (objc_property_attribute (objc_macro_invocation name: (objc_macro_name)))) type: (type_identifier) declarator: (pointer_declarator declarator: (identifier)))))================================================================================__has_include takes a header path, and a class may carry __exported================================================================================#if __has_include(<OpenGL/OpenGL.h>)class __exported IOFoo : public IOBar{};#endif--------------------------------------------------------------------------------(translation_unit (preproc_if condition: (call_expression function: (identifier) arguments: (argument_list (system_lib_string))) (class_specifier name: (type_identifier) (base_class_clause (access_specifier) (type_identifier)) body: (field_declaration_list))))================================================================================Macros work inside an include guard================================================================================#ifndef FOO_HNS_ASSUME_NONNULL_BEGINMT_EXPORT CFTypeID MTGetTypeID(void) API_AVAILABLE(macos(10.9));@interface A@endNS_ASSUME_NONNULL_END#endif--------------------------------------------------------------------------------(translation_unit (preproc_ifdef name: (identifier) (objc_macro_invocation name: (objc_macro_name)) (objc_macro_invocation name: (objc_macro_name)) (declaration type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type)))) (objc_macro_invocation name: (objc_macro_name) arguments: (objc_macro_arguments (objc_macro_argument_text)))) (objc_class_interface name: (type_identifier)) (objc_macro_invocation name: (objc_macro_name))))================================================================================A macro may annotate a block pointer typedef================================================================================typedef void (^ NS_SWIFT_SENDABLE MTLDrawableHandler)(id<MTLDrawable>);--------------------------------------------------------------------------------(translation_unit (type_definition type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (block_pointer_declarator (objc_macro_invocation name: (objc_macro_name)) declarator: (type_identifier))) parameters: (parameter_list (parameter_declaration type: (template_type name: (type_identifier) arguments: (template_argument_list (type_descriptor type: (type_identifier)))))))))================================================================================A macro that supplies its own semicolon leaves a stray one behind================================================================================@implementation ARCT_EXPORT_MODULE();- (void)f {}@end--------------------------------------------------------------------------------(translation_unit (objc_class_implementation name: (type_identifier) body: (objc_macro_invocation name: (objc_macro_name) arguments: (objc_macro_arguments)) body: (objc_method_definition scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector name: (identifier)) body: (compound_statement))))================================================================================Only the first piece of a concatenated string needs its sigil================================================================================void f() { log(@"the first part" " and the rest" @" and a sigil again");}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (objc_string_literal value: (string_literal (string_content)) value: (string_literal (string_content)) value: (string_literal (string_content)))))))))================================================================================An else may be split from its branch by a preprocessor boundary================================================================================void f() {#if defined(__MAC_10_13) if (available) { modern(); } else#endif { legacy(); }}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (preproc_if condition: (preproc_defined (identifier)) (if_statement condition: (condition_clause value: (identifier)) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list)))) alternative: (else_clause))) (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list)))))))================================================================================A macro call in statement position is a call, not a macro invocation================================================================================void f() { RCT_ASSERT(x); EXPECT_TRUE(y) << "message";}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (binary_expression left: (call_expression function: (identifier) arguments: (argument_list (identifier))) right: (string_literal (string_content)))))))================================================================================A macro may sit between a method selector and its body================================================================================@implementation A- (void)webView:(WKWebView *)w WX_API_AVAILABLE_MACOS(10, 13){}@end--------------------------------------------------------------------------------(translation_unit (objc_class_implementation name: (type_identifier) body: (objc_method_definition scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector parameter: (objc_method_parameter keyword: (identifier) type: (objc_method_type (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator))) name: (identifier))) (objc_macro_invocation name: (objc_macro_name) arguments: (objc_macro_arguments (objc_macro_argument_text))) body: (compound_statement))))================================================================================id and Class are ordinary names, not keywords================================================================================void f() { int id = 3; if (id == wxID_HELP) { g(); }}--------------------------------------------------------------------------------(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list)) body: (compound_statement (declaration type: (primitive_type) declarator: (init_declarator declarator: (identifier) value: (number_literal))) (if_statement condition: (condition_clause value: (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))))================================================================================Interface Builder markers sit where a qualifier would================================================================================@interface A@property (strong, nonatomic) IBOutlet UILabel *titleLabel;@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (objc_property_declaration attributes: (objc_property_attribute_list attribute: (objc_property_attribute) attribute: (objc_property_attribute)) (type_qualifier) type: (type_identifier) declarator: (pointer_declarator declarator: (identifier)))))================================================================================A lowercase annotation macro may trail a method declaration================================================================================@interface A- (void)requestReload __deprecated_msg("Use RCTReloadCommand instead");@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface name: (type_identifier) body: (objc_method_declaration scope: (objc_method_scope) return_type: (objc_method_type (type_descriptor type: (primitive_type))) selector: (objc_method_selector name: (identifier)) (objc_lowercase_macro name: (objc_macro_name) arguments: (objc_macro_arguments (objc_macro_argument_text))))))================================================================================An attribute may precede a class interface================================================================================__attribute__((objc_subclassing_restricted))@interface A : NSObject@end--------------------------------------------------------------------------------(translation_unit (objc_class_interface (attribute_specifier (argument_list (identifier))) name: (type_identifier) superclass: (type_identifier)))