Text Editor: Add GLSL support language #116793
|
@ -388,11 +388,11 @@ static char txtfmt_glsl_format_identifier(const char *str)
|
|||
|
||||
/* clang-format off */
|
||||
|
||||
if (txtfmt_glsl_find_specialvar(str) != -1) {fmt = FMT_TYPE_SPECIAL;}
|
||||
else if (txtfmt_glsl_find_builtinfunc(str) != -1) {fmt = FMT_TYPE_KEYWORD;}
|
||||
else if (txtfmt_glsl_find_reserved(str) != -1) {fmt = FMT_TYPE_RESERVED;}
|
||||
else if (txtfmt_glsl_find_preprocessor(str) != -1) {fmt = FMT_TYPE_DIRECTIVE;}
|
||||
else {fmt = FMT_TYPE_DEFAULT;}
|
||||
if (txtfmt_glsl_find_specialvar(str) != -1) {fmt = FMT_TYPE_SPECIAL;
|
||||
} else if (txtfmt_glsl_find_builtinfunc(str) != -1) {fmt = FMT_TYPE_KEYWORD;
|
||||
} else if (txtfmt_glsl_find_reserved(str) != -1) {fmt = FMT_TYPE_RESERVED;
|
||||
Gangneron marked this conversation as resolved
Outdated
|
||||
} else if (txtfmt_glsl_find_preprocessor(str) != -1) {fmt = FMT_TYPE_DIRECTIVE;
|
||||
} else {fmt = FMT_TYPE_DEFAULT;
|
||||
Gangneron marked this conversation as resolved
Outdated
Campbell Barton
commented
Missing closing brace. Missing closing brace.
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
|
@ -403,13 +403,13 @@ static char txtfmt_glsl_format_identifier(const char *str)
|
|||
*/
|
||||
static void txtfmt_glsl_format_line(SpaceText *st, TextLine * line, const bool do_next)
|
||||
{
|
||||
FlattenString fs;
|
||||
const char *str;
|
||||
char *fmt;
|
||||
char cont_orig, cont, find, prev = '';
|
||||
int len, i;
|
||||
FlattenString fs;
|
||||
const char *str;
|
||||
char *fmt;
|
||||
char cont_orig, cont, find, prev = ' ';
|
||||
fclem marked this conversation as resolved
Outdated
Campbell Barton
commented
empty character constant empty character constant
Gangneron
commented
I don't see what I need to change I don't see what I need to change
Gangneron
commented
c'est un code identique à text_format_osl c'est un code identique à text_format_osl
Campbell Barton
commented
What is the value of prev expected to be? Two single quotes without spaces doesn't define a character. OSL for example sets What is the value of prev expected to be? Two single quotes without spaces doesn't define a character. OSL for example sets `prev = ' '`.
|
||||
int len, i;
|
||||
|
||||
if (line->prev && line->prev->format != nullptr) {
|
||||
if (line->prev && line->prev->format != nullptr) {
|
||||
fmt = line->prev->format;
|
||||
cont = fmt[strlen(fmt) + 1]; /* Just after the null-terminator. */
|
||||
BLI_assert((FMT_CONT_ALL & cont) == cont);
|
||||
|
@ -577,7 +577,7 @@ void ED_text_format_register_glsl()
|
|||
tft.format_identifier = txtfmt_glsl_format_identifier;
|
||||
tft.format_line = txtfmt_glsl_format_line;
|
||||
tft.ext = ext;
|
||||
tft.comment_line = "//";
|
||||
tft.comment_line = "/**/";
|
||||
|
||||
ED_text_format_register(&tft);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
You should run
make format
to avoid any custom formatting issues.This block is copy pasted from an area which uses
/* clang-format off */
. So either drop the special formatting or make sure it is correctly formatted and add back the/* clang-format off */
. Same goes for the other occurrence of this part.