[Bf-blender-cvs] [33ab011ae49] master: Tweak and extend POV syntax hilghting.

Bastien Montagne noreply at git.blender.org
Thu Aug 10 15:34:00 CEST 2017


Commit: 33ab011ae4928cbbb49115abf653d91b8f3ba4d2
Author: Bastien Montagne
Date:   Thu Aug 10 15:29:19 2017 +0200
Branches: master
https://developer.blender.org/rB33ab011ae4928cbbb49115abf653d91b8f3ba4d2

Tweak and extend POV syntax hilghting.

*Changed categories of some keywords
*reordered some longer keywords that didn't appear
*Activated another color (reserved builtins) by Leonid
*added some HGPOV and UberPOV missing keywords

Patch by Maurice Raybaud (@mauriceraybaud). Thanks to Leonid for additions, feedback and Linux testing.
Related diffs: D2754 and D2755.

While not a regression, this is new feature and would be nice to have it
backported to final 2.79.

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

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 0d19c503798..1ef3322711c 100644
--- a/source/blender/editors/space_text/text_format_pov.c
+++ b/source/blender/editors/space_text/text_format_pov.c
@@ -49,36 +49,38 @@ static int txtfmt_pov_find_keyword(const char *string)
 {
 	int i, len;
 	/* Language Directives */
-	if      (STR_LITERAL_STARTSWITH(string, "append",      len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "break",       len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "case",        len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "debug",       len)) i = len;
+	if      (STR_LITERAL_STARTSWITH(string, "deprecated",  len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "persistent",  len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "statistics",  len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "version",     len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "warning",     len)) i = len;
 	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, "include",     len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "append",      len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "elseif",      len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "debug",       len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "break",  	   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, "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, "patch",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "local",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "macro",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "range",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "read",        len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "render",      len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "statistics",  len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "switch",      len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "undef",       len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "version",     len)) i = len;
-	else if (STR_LITERAL_STARTSWITH(string, "warning",     len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "while",       len)) i = len;
 	else if (STR_LITERAL_STARTSWITH(string, "write",       len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "case",        len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "end",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "for",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "if",          len)) i = len;
 	else                                                         i = 0;
 
 	/* If next source char is an identifier (eg. 'i' in "definate") no match */
@@ -92,221 +94,275 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
 	 * list is from...
 	 * http://www.povray.org/documentation/view/3.7.0/212/
 	 */
+
+	/* Float Functions */
+	if 		(STR_LITERAL_STARTSWITH(string, "conserve_energy",    len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "max_intersections",  len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "dimension_size",     len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "bitwise_and",        len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "bitwise_or",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "bitwise_xor",        len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "file_exists",        len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "precompute",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "dimensions",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "clipped_by",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "shadowless",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "turb_depth",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "reciprocal",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "quaternion",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "phong_size",         len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "tesselate",          len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "save_file",          len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "load_file",          len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "max_trace",          len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "transform",          len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "translate",          len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "direction",          len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "roughness",          len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "metallic",           len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "gts_load",           len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "gts_save",           len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "location",           len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "altitude",           len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "function",           len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "evaluate",           len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "inverse",            len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "collect",            len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "target",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "albedo",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "rotate",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "matrix",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "look_at",            len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "jitter",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "angle",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "right",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "scale",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "child",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "crand",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "blink",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "defined",            len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "degrees",            len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "inside",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "radians",            len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "vlength",            len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "select",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "floor",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "strcmp",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "strlen",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "tessel",             len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "sturm",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "abs",                len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "acosh",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "prod",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "with",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "acos",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "asc",                len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "asinh",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "asin",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "atan2",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "atand",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "atanh",              len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "atan",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "ceil",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "warp",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "cosh",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "log",                len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "max",                len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "min",                len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "mod",                len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "pow",                len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "rand",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "seed",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "form",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "sinh",               len)) i = len;
+	else if (STR_LITERAL_STARTSWITH(string, "sqrt",               len)) i = len;
+	else if (STR_L

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list