summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorIma Mechanique <ima.mechanique@secondlife.com>2013-10-21 04:09:20 +0100
committerIma Mechanique <ima.mechanique@secondlife.com>2013-10-21 04:09:20 +0100
commit79645e6981a97224024c5226d8713dce9569d54a (patch)
tree724993b295f45f4a4ef633c5503b0b07f07f5f15 /indra
parentbccbcced5426d95353f07ec2e8bb12c0b1ec03bf (diff)
STORM-1831 First attempt at using SyntaxIdLSL capability. (incomplete)
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llui/llkeywords.cpp6
-rwxr-xr-xindra/llui/llkeywords.h3
-rwxr-xr-xindra/newview/CMakeLists.txt2
-rwxr-xr-xindra/newview/llpreviewscript.cpp10
-rwxr-xr-xindra/newview/llpreviewscript.h2
5 files changed, 18 insertions, 5 deletions
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index 33a8cc947d..687c2fb31d 100755
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -29,7 +29,6 @@
#include <iostream>
#include <fstream>
-#include "lldir.h"
#include "llkeywords.h"
#include "llsdserialize.h"
#include "lltexteditor.h"
@@ -70,7 +69,7 @@ inline BOOL LLKeywordToken::isTail(const llwchar* s) const
LLKeywords::LLKeywords() : mLoaded(FALSE)
{
- setFilenameSyntax( gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keywords_lsl_default.xml") );
+ //setFilenameSyntax( gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keywords_lsl_default.xml") );
}
LLKeywords::~LLKeywords()
@@ -199,9 +198,10 @@ LLColor4 LLKeywords::getColorGroup(const std::string key_in)
return LLUIColorTable::instance().getColor(ColourGroup);
}
-BOOL LLKeywords::initialise()
+BOOL LLKeywords::initialise(ELLPath path, const std::string filename)
{
mReady = false;
+ setFilenameSyntax( gDirUtilp->getExpandedFilename(path, filename) );
if (! loadIntoLLSD(mFilenameSyntax, mSyntax) )
{
diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h
index 77a12bc1e5..1bd23549d2 100755
--- a/indra/llui/llkeywords.h
+++ b/indra/llui/llkeywords.h
@@ -28,6 +28,7 @@
#define LL_LLKEYWORDS_H
+#include "lldir.h"
#include "llstring.h"
#include "v3color.h"
#include "v4color.h"
@@ -116,7 +117,7 @@ public:
void setFilenameSyntax(const std::string filename) { mFilenameSyntax = filename; }
void findSegments(std::vector<LLTextSegmentPtr> *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor );
- BOOL initialise();
+ BOOL initialise(ELLPath path, const std::string filename);
std::string processColors();
std::string processColors(LLSD &data, const std::string strGroup);
void processTokens();
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 97243bc8b1..b7627f2eb0 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -519,6 +519,7 @@ set(viewer_SOURCE_FILES
llstylemap.cpp
llsurface.cpp
llsurfacepatch.cpp
+ llsyntaxid.cpp
llsyswellitem.cpp
llsyswellwindow.cpp
llteleporthistory.cpp
@@ -1093,6 +1094,7 @@ set(viewer_HEADER_FILES
llstylemap.h
llsurface.h
llsurfacepatch.h
+ llsyntaxid.h
llsyswellitem.h
llsyswellwindow.h
lltable.h
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 2e9907fcd2..62e1d765b3 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -406,7 +406,15 @@ BOOL LLScriptEdCore::postBuild()
initMenu();
- mEditor->mKeywords.initialise();
+// Make this work ;-)
+ mSyntaxLSL = LLSyntaxIdLSL();
+
+// mSyntaxLSL.initialise();
+// mSyntaxLSL.mKeywords = &mEditor->mKeywords;
+ // ...
+// mSyntaxLSL->mKeywords.initialise();
+// Move into the SyntaxIdLSL class
+ mEditor->mKeywords.initialise(mSyntaxLSL.filenamePath(), mSyntaxLSL.filenameCurrent());
// FIX: Refactor LLTextEditor::loadKeywords so these can be removed.
std::vector<std::string> funcs;
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index 9fb0a4fb63..21e33f30d5 100755
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -35,6 +35,7 @@
#include "lliconctrl.h"
#include "llframetimer.h"
#include "llfloatergotoline.h"
+#include "llsyntaxid.h"
class LLLiveLSLFile;
class LLMessageSystem;
@@ -149,6 +150,7 @@ private:
BOOL mEnableSave;
BOOL mHasScriptData;
LLLiveLSLFile* mLiveFile;
+ LLSyntaxIdLSL mSyntaxLSL;
LLScriptEdContainer* mContainer; // parent view
};