diff options
-rw-r--r-- | src/PropSet.cxx | 78 | ||||
-rw-r--r-- | win32/makefile | 35 | ||||
-rw-r--r-- | win32/scintilla.mak | 47 |
3 files changed, 53 insertions, 107 deletions
diff --git a/src/PropSet.cxx b/src/PropSet.cxx index 48b6cc782..caa8c6b2c 100644 --- a/src/PropSet.cxx +++ b/src/PropSet.cxx @@ -36,40 +36,10 @@ inline unsigned int HashString(const char *s) { return ret; } -// Get a line of input. If end of line escaped with '\\' then continue reading. -static bool GetFullLine(const char *&fpc, int &lenData, char *s, int len) { - bool continuation = true; - s[0] = '\0'; - while ((len > 1) && lenData > 0) { - char ch = *fpc; - fpc++; - lenData--; - if ((ch == '\r') || (ch == '\n')) { - if (!continuation) { - if ((lenData > 0) && (ch == '\r') && ((*fpc) == '\n')) { - // munch the second half of a crlf - fpc++; - lenData--; - } - *s = '\0'; - return true; - } - } else if ((ch == '\\') && (lenData > 0) && ((*fpc == '\r') || (*fpc == '\n'))) { - continuation = true; - } else { - continuation = false; - *s++ = ch; - *s = '\0'; - len--; - } - } - return false; -} - PropSet::PropSet() { superPS = 0; - for (int root=0; root < hashRoots; root++) - props[root] = 0; + for (int root=0; root < hashRoots; root++) + props[root] = 0; } PropSet::~PropSet() { @@ -162,7 +132,7 @@ int PropSet::GetInt(const char *key, int defaultValue) { return defaultValue; } -inline bool isprefix(const char *target, const char *prefix) { +bool isprefix(const char *target, const char *prefix) { while (*target && *prefix) { if (*target != *prefix) return false; @@ -288,47 +258,6 @@ void PropSet::Clear() { } } -void PropSet::ReadFromMemory(const char *data, int len, const char *directoryForImports) { - const char *pd = data; - char linebuf[60000]; - bool ifIsTrue = true; - while (len > 0) { - GetFullLine(pd, len, linebuf, sizeof(linebuf)); - if (isalpha(linebuf[0])) // If clause ends with first non-indented line - ifIsTrue = true; - if (isprefix(linebuf, "if ")) { - const char *expr = linebuf + strlen("if") + 1; - ifIsTrue = GetInt(expr); - } else if (isprefix(linebuf, "import ") && directoryForImports) { - char importPath[1024]; - strcpy(importPath, directoryForImports); - strcat(importPath, linebuf + strlen("import") + 1); - strcat(importPath, ".properties"); - Read(importPath,directoryForImports); - } else if (isalpha(linebuf[0])) { - Set(linebuf); - } else if (isspace(linebuf[0]) && ifIsTrue) { - Set(linebuf); - } - } -} - -void PropSet::Read(const char *filename, const char *directoryForImports) { - char propsData[60000]; -#ifdef __vms - FILE *rcfile = fopen(filename, "r"); -#else - FILE *rcfile = fopen(filename, "rb"); -#endif - if (rcfile) { - int lenFile = fread(propsData, 1, sizeof(propsData), rcfile); - fclose(rcfile); - ReadFromMemory(propsData, lenFile, directoryForImports); - } else { - //printf("Could not open <%s>\n", filename); - } -} - static bool iswordsep(char ch, bool onlyLineEnds) { if (!isspace(ch)) return false; @@ -744,3 +673,4 @@ char *WordList::GetNearestWords(const char *wordStart, int searchLen /*= -1*/, b free(buffer); return NULL; } + diff --git a/win32/makefile b/win32/makefile index c3a0e3435..13ef967eb 100644 --- a/win32/makefile +++ b/win32/makefile @@ -57,37 +57,38 @@ CellBuffer.o: CellBuffer.cxx Platform.h Scintilla.h CellBuffer.h ContractionState.o: ContractionState.cxx Platform.h ContractionState.h Document.o: Document.cxx Platform.h Scintilla.h CellBuffer.h \ Document.h -DocumentAccessor.o: DocumentAccessor.cxx Platform.h PropSet.h Accessor.h DocumentAccessor.h Scintilla.h +DocumentAccessor.o: DocumentAccessor.cxx Platform.h PropSet.h \ + SString.h Accessor.h DocumentAccessor.h Scintilla.h Editor.o: Editor.cxx Platform.h Scintilla.h ContractionState.h \ CellBuffer.h KeyMap.h Indicator.h LineMarker.h Style.h ViewStyle.h \ Document.h Editor.h Indicator.o: Indicator.cxx Platform.h Scintilla.h Indicator.h KeyMap.o: KeyMap.cxx Platform.h Scintilla.h KeyMap.h -LexConf.o: LexConf.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +LexConf.o: LexConf.cxx Platform.h PropSet.h \ + SString.h Accessor.h KeyWords.h Scintilla.h SciLexer.h +LexCPP.o: LexCPP.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h -LexCPP.o: LexCPP.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +LexHTML.o: LexHTML.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h -LexHTML.o: LexHTML.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +LexLua.o: LexLua.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h -LexLua.o: LexLua.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +LexOthers.o: LexOthers.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h -LexOthers.o: LexOthers.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +LexPascal.o: LexPascal.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h -LexPascal.o: LexPascal.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +LexPerl.o: LexPerl.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h -LexPerl.o: LexPerl.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +LexPython.o: LexPython.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h -LexPython.o: LexPython.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +LexSQL.o: LexSQL.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h -LexSQL.o: LexSQL.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +LexVB.o: LexVB.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h -LexVB.o: LexVB.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ - Scintilla.h SciLexer.h -KeyWords.o: KeyWords.cxx Platform.h PropSet.h Accessor.h KeyWords.h \ +KeyWords.o: KeyWords.cxx Platform.h PropSet.h SString.h Accessor.h KeyWords.h \ Scintilla.h SciLexer.h LineMarker.o: LineMarker.cxx Platform.h Scintilla.h LineMarker.h PlatWin.o: PlatWin.cxx Platform.h PlatformRes.h UniConversion.h -PropSet.o: PropSet.cxx Platform.h PropSet.h +PropSet.o: PropSet.cxx Platform.h PropSet.h SString.h ScintillaBase.o: ScintillaBase.cxx Platform.h Scintilla.h \ ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \ LineMarker.h Style.h ViewStyle.h AutoComplete.h Document.h Editor.h \ @@ -95,7 +96,7 @@ ScintillaBase.o: ScintillaBase.cxx Platform.h Scintilla.h \ ScintillaBaseL.o: ScintillaBase.cxx Platform.h Scintilla.h SciLexer.h \ ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \ LineMarker.h Style.h AutoComplete.h ViewStyle.h Document.h Editor.h \ - ScintillaBase.h PropSet.h Accessor.h DocumentAccessor.h KeyWords.h + ScintillaBase.h PropSet.h SString.h Accessor.h DocumentAccessor.h KeyWords.h ScintillaWin.o: ScintillaWin.cxx Platform.h Scintilla.h \ ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \ LineMarker.h Style.h AutoComplete.h ViewStyle.h Document.h Editor.h \ @@ -103,7 +104,7 @@ ScintillaWin.o: ScintillaWin.cxx Platform.h Scintilla.h \ ScintillaWinL.o: ScintillaWin.cxx Platform.h Scintilla.h SciLexer.h \ ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \ LineMarker.h Style.h AutoComplete.h ViewStyle.h Document.h Editor.h \ - ScintillaBase.h PropSet.h Accessor.h KeyWords.h UniConversion.h + ScintillaBase.h PropSet.h SString.h Accessor.h KeyWords.h UniConversion.h ScintillaWinS.o: ScintillaWin.cxx Platform.h Scintilla.h \ ContractionState.h CellBuffer.h CallTip.h KeyMap.h Indicator.h \ LineMarker.h Style.h AutoComplete.h ViewStyle.h Document.h Editor.h \ @@ -112,7 +113,7 @@ Style.o: Style.cxx Platform.h Style.h UniConversion.o: UniConversion.cxx UniConversion.h ViewStyle.o: ViewStyle.cxx Platform.h Scintilla.h Indicator.h \ LineMarker.h Style.h ViewStyle.h -WindowAccessor.o: DocumentAccessor.cxx Platform.h PropSet.h Accessor.h WindowAccessor.h Scintilla.h +WindowAccessor.o: DocumentAccessor.cxx Platform.h PropSet.h SString.h Accessor.h WindowAccessor.h Scintilla.h ScintillaBaseL.o: $(CC) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@ diff --git a/win32/scintilla.mak b/win32/scintilla.mak index 924919a6c..cad0b4e13 100644 --- a/win32/scintilla.mak +++ b/win32/scintilla.mak @@ -188,7 +188,8 @@ $(DIR_O)\ContractionState.obj: ..\src\ContractionState.cxx ..\include\Platform.h $(DIR_O)\Document.obj: ..\src\Document.cxx ..\include\Platform.h ..\include\Scintilla.h ..\src\CellBuffer.h \ ..\src\Document.h -$(DIR_O)\DocumentAccessor.obj: ..\src\DocumentAccessor.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\src\DocumentAccessor.h ..\include\Scintilla.h +$(DIR_O)\DocumentAccessor.obj: ..\src\DocumentAccessor.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\src\DocumentAccessor.h ..\include\Scintilla.h $(DIR_O)\Editor.obj: ..\src\Editor.cxx ..\include\Platform.h ..\include\Scintilla.h ..\src\ContractionState.h \ ..\src\CellBuffer.h ..\src\KeyMap.h ..\src\Indicator.h ..\src\LineMarker.h ..\src\Style.h ..\src\ViewStyle.h \ @@ -198,44 +199,56 @@ $(DIR_O)\Indicator.obj: ..\src\Indicator.cxx ..\include\Platform.h ..\include\Sc $(DIR_O)\KeyMap.obj: ..\src\KeyMap.cxx ..\include\Platform.h ..\include\Scintilla.h ..\src\KeyMap.h -$(DIR_O)\KeyWords.obj: ..\src\KeyWords.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\KeyWords.obj: ..\src\KeyWords.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexCPP.obj: ..\src\LexCPP.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexCPP.obj: ..\src\LexCPP.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexConf.obj: ..\src\LexConf.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexConf.obj: ..\src\LexConf.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexHTML.obj: ..\src\LexHTML.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexHTML.obj: ..\src\LexHTML.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexLua.obj: ..\src\LexLua.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexLua.obj: ..\src\LexLua.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexOthers.obj: ..\src\LexOthers.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexOthers.obj: ..\src\LexOthers.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexPerl.obj: ..\src\LexPerl.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexPerl.obj: ..\src\LexPerl.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexPascal.obj: ..\src\LexPascal.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexPascal.obj: ..\src\LexPascal.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexPython.obj: ..\src\LexPython.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexPython.obj: ..\src\LexPython.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexSQL.obj: ..\src\LexSQL.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexSQL.obj: ..\src\LexSQL.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h -$(DIR_O)\LexVB.obj: ..\src\LexVB.cxx ..\include\Platform.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h \ +$(DIR_O)\LexVB.obj: ..\src\LexVB.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h \ ..\include\Scintilla.h ..\include\SciLexer.h $(DIR_O)\LineMarker.obj: ..\src\LineMarker.cxx ..\include\Platform.h ..\include\Scintilla.h ..\src\LineMarker.h $(DIR_O)\PlatWin.obj: PlatWin.cxx ..\include\Platform.h PlatformRes.h ..\src\UniConversion.h -$(DIR_O)\PropSet.obj: ..\src\PropSet.cxx ..\include\Platform.h ..\include\PropSet.h +$(DIR_O)\PropSet.obj: ..\src\PropSet.cxx ..\include\Platform.h ..\include\PropSet.h \ + ..\include\SString.h $(DIR_O)\ScintillaBase.obj: ..\src\ScintillaBase.cxx ..\include\Platform.h ..\include\Scintilla.h \ ..\src\ContractionState.h ..\src\CellBuffer.h ..\src\CallTip.h ..\src\KeyMap.h ..\src\Indicator.h \ @@ -245,7 +258,8 @@ $(DIR_O)\ScintillaBase.obj: ..\src\ScintillaBase.cxx ..\include\Platform.h ..\in $(DIR_O)\ScintillaBaseL.obj: ..\src\ScintillaBase.cxx ..\include\Platform.h ..\include\Scintilla.h ..\include\SciLexer.h \ ..\src\ContractionState.h ..\src\CellBuffer.h ..\src\CallTip.h ..\src\KeyMap.h ..\src\Indicator.h \ ..\src\LineMarker.h ..\src\Style.h ..\src\AutoComplete.h ..\src\ViewStyle.h ..\src\Document.h ..\src\Editor.h \ - ..\src\ScintillaBase.h ..\include\PropSet.h ..\include\Accessor.h ..\src\DocumentAccessor.h ..\include\KeyWords.h + ..\src\ScintillaBase.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\src\DocumentAccessor.h ..\include\KeyWords.h $(DIR_O)\ScintillaWin.obj: ScintillaWin.cxx ..\include\Platform.h ..\include\Scintilla.h \ ..\src\ContractionState.h ..\src\CellBuffer.h ..\src\CallTip.h ..\src\KeyMap.h ..\src\Indicator.h \ @@ -255,7 +269,8 @@ $(DIR_O)\ScintillaWin.obj: ScintillaWin.cxx ..\include\Platform.h ..\include\Sci $(DIR_O)\ScintillaWinL.obj: ScintillaWin.cxx ..\include\Platform.h ..\include\Scintilla.h ..\include\SciLexer.h \ ..\src\ContractionState.h ..\src\CellBuffer.h ..\src\CallTip.h ..\src\KeyMap.h ..\src\Indicator.h \ ..\src\LineMarker.h ..\src\Style.h ..\src\AutoComplete.h ..\src\ViewStyle.h ..\src\Document.h ..\src\Editor.h \ - ..\src\ScintillaBase.h ..\include\PropSet.h ..\include\Accessor.h ..\include\KeyWords.h ..\src\UniConversion.h + ..\src\ScintillaBase.h ..\include\PropSet.h \ + ..\include\SString.h ..\include\Accessor.h ..\include\KeyWords.h ..\src\UniConversion.h $(DIR_O)\ScintillaWinS.obj: ScintillaWin.cxx ..\include\Platform.h ..\include\Scintilla.h \ ..\src\ContractionState.h ..\src\CellBuffer.h ..\src\CallTip.h ..\src\KeyMap.h ..\src\Indicator.h \ @@ -270,4 +285,4 @@ $(DIR_O)\ViewStyle.obj: ..\src\ViewStyle.cxx ..\include\Platform.h ..\include\Sc $(DIR_O)\UniConversion.obj: ..\src\UniConversion.cxx ..\src\UniConversion.h $(DIR_O)\WindowAccessor.obj: ..\src\WindowAccessor.cxx ..\include\Platform.h ..\include\PropSet.h \ - ..\include\Accessor.h ..\include\WindowAccessor.h ..\include\Scintilla.h + ..\include\SString.h ..\include\Accessor.h ..\include\WindowAccessor.h ..\include\Scintilla.h |