[Bf-blender-cvs] [116e8933a64] master: Fix some POV keywords not colored correctly.

Bastien Montagne noreply at git.blender.org
Tue May 23 17:10:01 CEST 2017


Commit: 116e8933a64fe5c0274cf17dd6e0f06df3ba4210
Author: Bastien Montagne
Date:   Tue May 23 16:41:48 2017 +0200
Branches: master
https://developer.blender.org/rB116e8933a64fe5c0274cf17dd6e0f06df3ba4210

Fix some POV keywords not colored correctly.

We need to ensure longer keywords are catched first, when there are
shorter subsets of them in keywords list as well!

===================================================================

M	source/blender/editors/space_text/text_format_pov.c
M	source/blender/editors/space_text/text_format_pov_ini.c

===================================================================

diff --git a/source/blender/editors/space_text/text_format_pov.c b/source/blender/editors/space_text/text_format_pov.c
index caf062c1e76..eb6877d297d 100644
--- a/source/blender/editors/space_text/text_format_pov.c
+++ b/source/blender/editors/space_text/text_format_pov.c
@@ -56,16 +56,16 @@ static int txtfmt_pov_find_keyword(const char *string)
 	else if (STR_LITERAL_STARTSWITH(string, "declare",     len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "default",     len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "deprecated",  len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "else",        len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "elseif",      len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "else",        len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "end",         len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "error",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "fclose",      len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "fopen",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "for",         len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "if",          len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "ifdef",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "ifndef",      len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "ifdef",       len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "if",          len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "include",     len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "local",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "macro",       len)) i = len;
@@ -99,13 +99,13 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
 	else if (STR_LITERAL_STARTSWITH(string, "accuracy",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "adc_bailout",         len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "albedo",              len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "all",                 len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "all_intersections",   len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "all",                 len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "alpha",               len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "altitude",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "always_sample",       len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "ambient",             len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "ambient_light",       len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "ambient",             len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "angle",               len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "aperture",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "arc_angle",           len)) i = len;
@@ -133,8 +133,8 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
 	else if (STR_LITERAL_STARTSWITH(string, "cutaway_textures",    len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "diffuse",             len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "direction",           len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "dispersion",          len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "dispersion_samples",  len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "dispersion",          len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "dist_exp",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "distance",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "eccentricity",        len)) i = len;
@@ -146,8 +146,8 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
 	else if (STR_LITERAL_STARTSWITH(string, "exterior",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "extinction",          len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "face_indices",        len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "falloff",             len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "falloff_angle",       len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "falloff",             len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "file_gamma",          len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "finish",              len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "flatness",            len)) i = len;
@@ -171,8 +171,8 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
 	else if (STR_LITERAL_STARTSWITH(string, "internal",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "intervals",           len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "ior",                 len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "irid",                len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "irid_wavelength",     len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "irid",                len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "load_file",           len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "location",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "look_at",             len)) i = len;
@@ -185,8 +185,8 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
 	else if (STR_LITERAL_STARTSWITH(string, "max_intersections",   len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "max_iteration",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "max_sample",          len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "max_trace",           len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "max_trace_level",     len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "max_trace",           len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "maximum_reuse",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "metallic",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "method",              len)) i = len;
@@ -202,8 +202,8 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
 	else if (STR_LITERAL_STARTSWITH(string, "orientation",         len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "pass_through",        len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "pattern",             len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "phong",               len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "phong_size",          len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "phong",               len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "point_at",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "pot",                 len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "precision",           len)) i = len;
@@ -218,8 +218,8 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
 	else if (STR_LITERAL_STARTSWITH(string, "ratio",               len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "reciprocal",          len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "recursion_limit",     len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "reflection",          len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "reflection_exponent", len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "reflection",          len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "refraction",          len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "repeat",              len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "right",               len)) i = len;
@@ -270,12 +270,13 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
 static int txtfmt_pov_find_reserved_builtins(const char *string)
 {
 	int i, len;
+
 	/* POV-Ray Built-in Variables
 	 * list is from...
 	 * http://www.povray.org/documentation/view/3.7.0/212/
 	 */
-	if      (STR_LITERAL_STARTSWITH(string, "clock",               len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "clock_delta",         len)) i = len;
+	if      (STR_LITERAL_STARTSWITH(string, "clock_delta",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "clock",               len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "clock_on",            len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "final_clock",         len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "final_frame",         len)) i = len;
@@ -285,28 +286,21 @@ static int txtfmt_pov_find_reserved_builtins(const char *string)
 	else if (STR_LITERAL_STARTSWITH(string, "image_height",        len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "image_width",         len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "input_file_name",     len)) i = len;
-	/* Built-in Vectors */
-	else if (STR_LITERAL_STARTSWITH(string, "t",                   len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "u",                   len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "v",                   len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "x",                   len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "y",                   len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "z",                   len)) i = len;
 	/* Color Identifiers */
 	else if (STR_LITERAL_STARTSWITH(string, "blue",                len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "filter",              len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "gray",                len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "green",               len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "red",                 len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "rgb",                 len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "rgbf",                len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "rgbft",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "rgbf",              

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list