Index: indra/llui/llkeywords.cpp =================================================================== --- indra/llui/llkeywords.cpp (revision 338) +++ indra/llui/llkeywords.cpp (working copy) @@ -59,6 +59,22 @@ return res; } +inline BOOL LLKeywordToken::isTail(const llwchar* s) const +{ + BOOL res = TRUE; + const llwchar* t = mDelimiter.c_str(); + S32 len = mDelimiter.size(); + for (S32 i=0; igetLength(); - if( cur_delimiter->getType() == LLKeywordToken::TWO_SIDED_DELIMITER ) + //if( cur_delimiter->getType() == LLKeywordToken::TWO_SIDED_DELIMITER ) + LLKeywordToken::TOKEN_TYPE type = cur_delimiter->getType(); + if( type == LLKeywordToken::TWO_SIDED_DELIMITER || type == LLKeywordToken::TWO_SIDED_DELIMITER_ESC ) { - while( *cur && !cur_delimiter->isHead(cur)) + //llassert( cur_delimiter->getDelimiter() != NULL ); + while( *cur && !cur_delimiter->isTail(cur) ) { // Check for an escape sequence. - if (*cur == '\\') + if (type == LLKeywordToken::TWO_SIDED_DELIMITER_ESC && *cur == '\\') { // Count the number of backslashes. S32 num_backslashes = 0; @@ -358,7 +398,7 @@ cur++; } // Is the next character the end delimiter? - if (cur_delimiter->isHead(cur)) + if (cur_delimiter->isTail(cur)) { // Is there was an odd number of backslashes, then this delimiter // does not end the sequence. @@ -384,7 +424,7 @@ if( *cur ) { cur += cur_delimiter->getLength(); - seg_end = seg_start + between_delimiters + 2 * cur_delimiter->getLength(); + seg_end = seg_start + between_delimiters + cur_delimiter->getLength() + cur_delimiter->getLength2(); } else { Index: indra/llui/llkeywords.h =================================================================== --- indra/llui/llkeywords.h (revision 338) +++ indra/llui/llkeywords.h (working copy) @@ -46,23 +46,27 @@ class LLKeywordToken { public: - enum TOKEN_TYPE { WORD, LINE, TWO_SIDED_DELIMITER, ONE_SIDED_DELIMITER }; + enum TOKEN_TYPE { WORD, LINE, TWO_SIDED_DELIMITER, ONE_SIDED_DELIMITER, TWO_SIDED_DELIMITER_ESC }; - LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip ) + LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter ) : mType( type ), mToken( token ), mColor( color ), - mToolTip( tool_tip ) + mToolTip( tool_tip ), + mDelimiter( delimiter ) // right delimiter { } S32 getLength() const { return mToken.size(); } + S32 getLength2() const { return mDelimiter.size(); } BOOL isHead(const llwchar* s) const; + BOOL isTail(const llwchar* s) const; const LLWString& getToken() const { return mToken; } const LLColor3& getColor() const { return mColor; } TOKEN_TYPE getType() const { return mType; } const LLWString& getToolTip() const { return mToolTip; } + const LLWString& getDelimiter() const { return mDelimiter; } #ifdef _DEBUG void dump(); @@ -73,6 +77,7 @@ LLWString mToken; LLColor3 mColor; LLWString mToolTip; + LLWString mDelimiter; }; class LLKeywords @@ -90,7 +95,8 @@ void addToken(LLKeywordToken::TOKEN_TYPE type, const std::string& key, const LLColor3& color, - const std::string& tool_tip = LLStringUtil::null); + const std::string& tool_tip = LLStringUtil::null, + const std::string& delimiter = LLStringUtil::null); typedef std::map word_token_map_t; typedef word_token_map_t::const_iterator keyword_iterator_t; Index: indra/newview/app_settings/keywords.ini =================================================================== --- indra/newview/app_settings/keywords.ini (revision 338) +++ indra/newview/app_settings/keywords.ini (working copy) @@ -557,9 +557,11 @@ # Comment [one_sided_delimiter .8, .3, .15] // Comment:Non-functional commentary or disabled code +[two_sided_delimiter .8, .3, .15] +/* */ Comment:Non-functional commentary or disabled code # String literals -[two_sided_delimiter 0, .2, 0] -" String literal +[two_sided_delimiter_esc 0, .2, 0] +" " String literal #functions are supplied by the program now.