objective c - Uncrustify spacing issue with macro inside method call -
i attempting use uncrustify on project of mine, running issues spacing changes makes when macro used receiver of objective-c message. example, given following macro , method call, expect spacing remain is.
#define nilornotnsnull(val) ({id __val = (val); (__val == [nsnull null]) ? nil : __val;}) title_ = [nilornotnsnull([dict objectforkey:@"post_title"]) copy];
however, result.
#define nilornotnsnull(val) ({id __val = (val); (__val == [nsnull null]) ? nil : __val;}) title_ = [nilornotnsnull ([dict objectforkey:@"post_title"])copy];
it appears if uncrustify not recognize text in parentheses argument macro, i'm not sure heck thinks is. seems uncrustify bug me, issue config, figured i'd ask here filing issue on github. here config i'm using: https://gist.github.com/812314
if offer insight, i'd appreciate it.
i don't exact output when run using config. version using? version output follows:
macbook-adamd:~ adamd$ uncrustify --version uncrustify 0.56
the output using config has backslash wraps macro's close parent newline:
#define nilornotnsnull(val) ({ id __val = (val); (__val == [nsnull null]) ? nil : __val; } \ ) title_ = [nilornotnsnull ([dict objectforkey:@"post_title"])copy];
that said, able eliminate space between nilornotnsnull
, open paren adding set func_call_user nilornotnsnull
top of config file. see documentation sp_func_call_user_paren
more information. seems have option set remove space, no definitions match.
here output set func_call_user nilornotnsnull
:
#define nilornotnsnull(val) ({ id __val = (val); (__val == [nsnull null]) ? nil : __val; } \ ) title_ = [nilornotnsnull([dict objectforkey:@"post_title"]) copy];
i forked gist , updated it: https://gist.github.com/815042
Comments
Post a Comment