From 378053bd4884a69502180fc81094a2a43832d0e3 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 25 Jun 2011 00:28:28 -0500 Subject: [PATCH] two_sided_delimiter workaround (Broken comment blocks in LSL '/*comment*/') Didn't want to mess with the token class for one single case. This fix is pretty straight-forward and self-contained. --- indra/llui/llkeywords.cpp | 7 +++++-- indra/newview/app_settings/keywords.ini | 5 +++-- indra/newview/skins/gemini/keywords.ini | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 51ef3dbac..b41263d97 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -344,7 +344,10 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLWS if( cur_delimiter->getType() == LLKeywordToken::TWO_SIDED_DELIMITER ) { - while( *cur && !cur_delimiter->isHead(cur)) + LLWString str = cur_delimiter->getToken(); + std::reverse(str.begin(),str.end()); //Flip the delim around (/* changes to */) + LLKeywordToken reverse_delimiter(cur_delimiter->getType(),cur_delimiter->getColor(),str,cur_delimiter->getToolTip()); + while( *cur && !reverse_delimiter.isHead(cur)) { // Check for an escape sequence. if (*cur == '\\') @@ -358,7 +361,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLWS cur++; } // Is the next character the end delimiter? - if (cur_delimiter->isHead(cur)) + if (reverse_delimiter.isHead(cur)) { // Is there was an odd number of backslashes, then this delimiter // does not end the sequence. diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 36a4cdc30..75c1740aa 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -644,11 +644,12 @@ return Leave current function or event handler # Comment [one_sided_delimiter .8, .3, .15] // Comment:Non-functional commentary or disabled code +# for now two_sided_delimiter spans from the token to the token, reversed. (eg: /* to */) [two_sided_delimiter .8, .3, .15] -/* */ Comment:Non-functional commentary or disabled code +/* Comment:Non-functional commentary or disabled code # String literals [two_sided_delimiter_esc 0, .2, 0] -" " String literal +" String literal #functions are supplied by the program now. diff --git a/indra/newview/skins/gemini/keywords.ini b/indra/newview/skins/gemini/keywords.ini index 58044b9a8..474c5351f 100644 --- a/indra/newview/skins/gemini/keywords.ini +++ b/indra/newview/skins/gemini/keywords.ini @@ -603,11 +603,12 @@ return Leave current function or event handler # Comment [one_sided_delimiter .86, .69, .50] // Comment:Non-functional commentary or disabled code +# for now two_sided_delimiter spans from the token to the token, reversed. (eg: /* to */) [two_sided_delimiter .86, .69, .50] -/* */ Comment:Non-functional commentary or disabled code +/* Comment:Non-functional commentary or disabled code # String literals [two_sided_delimiter_esc .57, .83, .52] -" " String literal +" String literal #functions are supplied by the program now.