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.
This commit is contained in:
Bastien Montagne 2017-08-10 15:29:19 +02:00 committed by Sergey Sharybin
parent ff47118c73
commit 0d86bc9f98
2 changed files with 586 additions and 489 deletions

File diff suppressed because it is too large Load Diff

View File

@ -49,36 +49,36 @@ static int txtfmt_ini_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, "statistics", 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, "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, "ifdef", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ifndef", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "if", 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, "include", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "fclose", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ifndef", 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, "error", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "fopen", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ifdef", 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, "break", 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, "else", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "read", 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 if (STR_LITERAL_STARTSWITH(string, "I", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "S", len)) i = len;
@ -104,13 +104,47 @@ static int txtfmt_ini_find_reserved(const char *string)
* list is from...
* http://www.povray.org/documentation/view/3.7.0/212/
*/
if (STR_LITERAL_STARTSWITH(string, "Antialias_Threshold", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Bounding_Method", 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;
else if (STR_LITERAL_STARTSWITH(string, "HideWhenMainMinimized", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Confidence", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseExtensions", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ReadWriteSourceDir", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionLeft", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionTop", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionRight", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionBottom", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionX", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionY", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Threshold", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Gamma", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Depth", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock_delta", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock_on", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "input_file_name", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Subset_Start_Frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Subset_End_Frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseToolbar", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseTooltips", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Frame_Step", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Cyclic_Animation", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Field_Render", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Odd_Field", 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;
else if (STR_LITERAL_STARTSWITH(string, "frame_number", len)) i = len;
@ -118,15 +152,6 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "initial_frame", len)) i = len;
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;
else if (STR_LITERAL_STARTSWITH(string, "Subset_Start_Frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Subset_End_Frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Frame_Step", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Cyclic_Animation", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Field_Render", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Odd_Field", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Height", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Width", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Start_Column", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Start_Row", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "End_Column", len)) i = len;
@ -134,7 +159,7 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "Test_Abort_Count", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Test_Abort", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Continue_Trace", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Create_Continue_Trace_Log", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Bounding_Method", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Create_Ini", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Display_Gamma", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Display", len)) i = len;
@ -151,19 +176,6 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "Bits_Per_Color", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Compression", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Dither_Method", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Dither", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Include_Header", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Library_Path", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Debug_Console", len)) i = len;
@ -187,7 +199,9 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "Remove_Bounds", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Split_Unions", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Glare_Desaturation", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Sampling_Method", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Stochastic_Seed", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Jitter_Amount", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Jitter", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Depth", len)) i = len;
@ -221,25 +235,14 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "Band3Width", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Band4Width", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ShowCmd", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionLeft", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionTop", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionRight", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionBottom", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseToolbar", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseTooltips", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionX", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionY", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Flags", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Transparency", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Use8BitMode", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "MakeActive", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "KeepAboveMain", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "HideWhenMainMinimized", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "AutoClose", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "PreserveBitmap", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "FontSize", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "FontWeight", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Font", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "KeepMessages", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "AlertSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Completion", len)) i = len;
@ -250,14 +253,6 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "PreventSleep", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NoShelloutWait", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "SystemNoActive", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSoundEnabled", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSoundEnabled", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSoundEnabled", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseExtensions", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ReadWriteSourceDir", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NoShellOuts", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "VideoSource", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "SceneFile", len)) i = len;
@ -269,6 +264,14 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "RenderwinClose", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Append_File", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Warning Level", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock_delta", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock_on", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Height", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Width", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Dither", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Flags", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Font", len)) i = len;
/* Filetypes */
else if (STR_LITERAL_STARTSWITH(string, "df3", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "exr", len)) i = len;