From b06e63acedbbbc0dafe24a04e866fcb4363601e8 Mon Sep 17 00:00:00 2001 From: Cinder Date: Sun, 8 Jun 2014 18:28:10 -0600 Subject: [PATCH] Fix lsl constant highlighting and sort the if-else chain to parse a little quicker --- indra/llui/llkeywords.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 95bdfa6fb3..75773d7dfd 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -173,14 +173,22 @@ std::string LLKeywords::getAttribute(const std::string& key) LLColor4 LLKeywords::getColorGroup(const std::string& key_in) { std::string color_group = "ScriptText"; - if (key_in == "constants") + if (key_in == "functions") { - color_group = "SyntaxLslConstant"; + color_group = "SyntaxLslFunction"; } else if (key_in == "controls") { color_group = "SyntaxLslControlFlow"; } + else if (key_in == "events") + { + color_group = "SyntaxLslEvent"; + } + else if (key_in == "types") + { + color_group = "SyntaxLslDataType"; + } else if (key_in == "misc-flow-label") { color_group = "SyntaxLslControlFlow"; @@ -189,21 +197,19 @@ LLColor4 LLKeywords::getColorGroup(const std::string& key_in) { color_group = "SyntaxLslDeprecated"; } - else if (key_in == "events") - { - color_group = "SyntaxLslEvent"; - } - else if (key_in == "functions") - { - color_group = "SyntaxLslFunction"; - } else if (key_in =="god-mode") { color_group = "SyntaxLslGodMode"; } - else if (key_in == "types") + else if (key_in == "constants" + || key_in == "constants-integer" + || key_in == "constants-float" + || key_in == "constants-string" + || key_in == "constants-key" + || key_in == "constants-rotation" + || key_in == "constants-vector") { - color_group = "SyntaxLslDataType"; + color_group = "SyntaxLslConstant"; } else {