2012-08-08 3 views
1

코드 서식 지정에 Uncrustify을 사용했습니다.Uncrustify는 LLVM 4.0의 새로운 Objective-C 구문을 지원하지 않습니다.

그러나 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 

실행 결과 : Result

답변

1

이 최신 uncrustify 릴리스에서 수정되었습니다 : 0.60.

당신은 여기를 잡을 수 있습니다 : 나는 브루를 사용하여 수동으로 brew edit uncrustify 다음 brew upgrade uncrustify으로 URL & SHA1을 업데이트했다있어 https://github.com/bengardner/uncrustify/archive/uncrustify-0.60.tar.gz

. 이제 마법처럼

require 'formula' 

class Uncrustify < Formula 
    url 'http://downloads.sourceforge.net/project/uncrustify/uncrustify/uncrustify-0.60/uncrustify-0.60.tar.gz' 
    head 'https://github.com/bengardner/uncrustify.git' 
    homepage 'http://uncrustify.sourceforge.net/' 
    sha1 '769a7649a1cefb80beff9b67b11b4b87a8cc8e0e' 

    def install 
    system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking" 
    system "make install" 
    end 
end 

작품 :

다음은 나의 새로운 공식이다.