我使用Uncrustify来格式化代码。
但是 Uncrustify 不支持 LLVM 4.0 的新 Objective-C 语法。
我要做什么?
Uncrustify 编写的代码:
@interface SJTLLVM4Tester()
@property (strong) NSNumber *number;
@end
@implementation SJTLLVM4Tester
-(id)init {
self = [super init];
if (self) {
self.number = @'C';
self.number = @123;
self.number = @0x123ul;
self.number = @-1.2e-3f;
self.number = @YES;
NSDictionary *dictionary = @{@"key1":@1,@"key2":@2,@"key3":@3};
NSMutableArray *array = [[NSMutableArray alloc] initWithArray:@[@1,@2,@3]];
self.number = dictionary[@"key1"];
array[0] = self.number;
}
return self;
}
@end
执行结果: