diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-16 17:53:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-16 17:57:47 +0300 |
commit | 2986bc1d6e5d89aa59e191f3b0e7eb0be7de42ba (patch) | |
tree | ca9e73673f9022f464f651bbc320f7ab37ea8574 /source/blender/editors/space_text/text_format_pov_ini.c | |
parent | e0fe7199971728dfa4e84cd3c63e17dde48d0c7a (diff) |
ClangFormat: add comments to ignore formatting
Diffstat (limited to 'source/blender/editors/space_text/text_format_pov_ini.c')
-rw-r--r-- | source/blender/editors/space_text/text_format_pov_ini.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/editors/space_text/text_format_pov_ini.c b/source/blender/editors/space_text/text_format_pov_ini.c index da69a35f0b0..5ef5746bffb 100644 --- a/source/blender/editors/space_text/text_format_pov_ini.c +++ b/source/blender/editors/space_text/text_format_pov_ini.c @@ -44,6 +44,10 @@ static int txtfmt_ini_find_keyword(const char *string) { int i, len; + + /* Keep aligned args for readability. */ + /* clang-format off */ + /* Language Directives */ if (STR_LITERAL_STARTSWITH(string, "deprecated", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "statistics", len)) i = len; @@ -89,6 +93,8 @@ static int txtfmt_ini_find_keyword(const char *string) else i = 0; + /* clang-format on */ + /* If next source char is an identifier (eg. 'i' in "definite") no match */ return (i == 0 || text_check_identifier(string[i])) ? -1 : i; } @@ -96,11 +102,15 @@ static int txtfmt_ini_find_keyword(const char *string) static int txtfmt_ini_find_reserved(const char *string) { int i, len; + + /* Keep aligned args for readability. */ + /* clang-format off */ + /* POV-Ray Built-in INI Variables * list is from... * http://www.povray.org/documentation/view/3.7.0/212/ */ - if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSoundEnabled", len)) i = len; + if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSoundEnabled", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Create_Continue_Trace_Log", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSoundEnabled", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSoundEnabled", len)) i = len; @@ -295,6 +305,8 @@ static int txtfmt_ini_find_reserved(const char *string) else i = 0; + /* clang-format on */ + /* If next source char is an identifier (eg. 'i' in "definite") no match */ return (i == 0 || text_check_identifier(string[i])) ? -1 : i; } @@ -305,6 +317,10 @@ static int txtfmt_ini_find_reserved(const char *string) static int txtfmt_ini_find_bool(const char *string) { int i, len; + + /* Keep aligned args for readability. */ + /* clang-format off */ + /* Built-in Constants */ if (STR_LITERAL_STARTSWITH(string, "false", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "no", len)) i = len; @@ -322,6 +338,8 @@ static int txtfmt_ini_find_bool(const char *string) else if (STR_LITERAL_STARTSWITH(string, "%w", len)) i = len; else i = 0; + /* clang-format on */ + /* If next source char is an identifier (eg. 'i' in "Nonetheless") no match */ return (i == 0 || text_check_identifier(string[i])) ? -1 : i; } @@ -445,11 +463,16 @@ static void txtfmt_pov_ini_format_line(SpaceText *st, TextLine *line, const bool } /* Not ws, a digit, punct, or continuing text. Must be new, check for special words */ else { + /* Keep aligned args for readability. */ + /* clang-format off */ + /* Special vars(v) or built-in keywords(b) */ /* keep in sync with 'txtfmt_ini_format_identifier()' */ if ((i = txtfmt_ini_find_keyword(str)) != -1) prev = FMT_TYPE_KEYWORD; else if ((i = txtfmt_ini_find_reserved(str)) != -1) prev = FMT_TYPE_RESERVED; + /* clang-format on */ + if (i > 0) { text_format_fill_ascii(&str, &fmt, prev, i); } |