From 87a3a96b3d5047f28d5d89b935014da1fcde1975 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 13 Jul 2010 21:44:00 +1000 Subject: For new lexer design change includes to add new files and remove unused files. Normalise order of includes. Minor fixes for compatibility with new lexer design. --- lexers/LexTeX.cxx | 56 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 26 deletions(-) (limited to 'lexers/LexTeX.cxx') diff --git a/lexers/LexTeX.cxx b/lexers/LexTeX.cxx index 62ade1d75..0b391b6bd 100644 --- a/lexers/LexTeX.cxx +++ b/lexers/LexTeX.cxx @@ -18,18 +18,22 @@ #include #include -#include #include #include +#include +#include -#include "Platform.h" - -#include "PropSet.h" -#include "Accessor.h" -#include "KeyWords.h" +#include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" + +#include "PropSetSimple.h" +#include "WordList.h" +#include "LexAccessor.h" +#include "Accessor.h" #include "StyleContext.h" +#include "CharacterSet.h" +#include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; @@ -285,8 +289,8 @@ static void ColouriseTeXDoc( static inline bool isNumber(int ch) { return - (ch == '0') || (ch == '1') || (ch == '2') || - (ch == '3') || (ch == '4') || (ch == '5') || + (ch == '0') || (ch == '1') || (ch == '2') || + (ch == '3') || (ch == '4') || (ch == '5') || (ch == '6') || (ch == '7') || (ch == '8') || (ch == '9'); } @@ -298,7 +302,7 @@ static int ParseTeXCommand(unsigned int pos, Accessor &styler, char *command) { int length=0; char ch=styler.SafeGetCharAt(pos+1); - + if(ch==',' || ch==':' || ch==';' || ch=='%'){ command[0]=ch; command[1]=0; @@ -311,14 +315,14 @@ static int ParseTeXCommand(unsigned int pos, Accessor &styler, char *command) length++; ch=styler.SafeGetCharAt(pos+length+1); } - - command[length]='\0'; + + command[length]='\0'; if(!length) return 0; return length+1; } static int classifyFoldPointTeXPaired(const char* s) { - int lev=0; + int lev=0; if (!(isdigit(s[0]) || (s[0] == '.'))){ if (strcmp(s, "begin")==0||strcmp(s,"FoldStart")==0|| strcmp(s,"abstract")==0||strcmp(s,"unprotect")==0|| @@ -330,14 +334,14 @@ static int classifyFoldPointTeXPaired(const char* s) { strcmp(s,"maketitle")==0||strcmp(s,"protect")==0|| strncmp(s,"stop",4)==0||strncmp(s,"Stop",4)==0|| strcmp(s,"fi")==0 - ) + ) lev=-1; } return lev; } static int classifyFoldPointTeXUnpaired(const char* s) { - int lev=0; + int lev=0; if (!(isdigit(s[0]) || (s[0] == '.'))){ if (strcmp(s,"part")==0|| strcmp(s,"chapter")==0|| @@ -362,7 +366,7 @@ static int classifyFoldPointTeXUnpaired(const char* s) { static bool IsTeXCommentLine(int line, Accessor &styler) { int pos = styler.LineStart(line); int eol_pos = styler.LineStart(line + 1) - 1; - + int startpos = pos; while (startpos