This commit was manufactured by cvs2svn to create branch
'WX_2_2_BRANCH'. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
138
contrib/src/stc/scintilla/include/PosRegExp.h
Normal file
138
contrib/src/stc/scintilla/include/PosRegExp.h
Normal file
@@ -0,0 +1,138 @@
|
||||
#ifndef POSREGEXP_H
|
||||
#define POSREGEXP_H
|
||||
|
||||
#define MatchesNum 0x10
|
||||
|
||||
enum EOps
|
||||
{
|
||||
ReBlockOps = 0x1000,
|
||||
ReMul, // *
|
||||
RePlus, // +
|
||||
ReQuest, // ?
|
||||
ReNGMul, // *?
|
||||
ReNGPlus, // +?
|
||||
ReNGQuest, // ??
|
||||
ReRangeN, // {n,}
|
||||
ReRangeNM, // {n,m}
|
||||
ReNGRangeN, // {n,}?
|
||||
ReNGRangeNM, // {n,m}?
|
||||
ReOr, // |
|
||||
ReBehind = 0x1100, // ?#n
|
||||
ReNBehind = 0x1200, // ?~n
|
||||
ReAhead = 0x1300, // ?=
|
||||
ReNAhead = 0x1400, // ?!
|
||||
|
||||
ReSymbolOps = 0x2000,
|
||||
ReEmpty,
|
||||
ReSymb, // a b \W \s ...
|
||||
ReEnum, // []
|
||||
ReNEnum, // [^]
|
||||
ReBrackets, // (...)
|
||||
ReBkTrace = 0x2100, // \yN
|
||||
ReBkBrack = 0x2200 // \N
|
||||
};
|
||||
|
||||
enum ESymbols
|
||||
{
|
||||
ReAnyChr = 0x4000, // .
|
||||
ReSoL, // ^
|
||||
ReEoL, // $
|
||||
ReDigit, // \d
|
||||
ReNDigit, // \D
|
||||
ReWordSymb, // \w
|
||||
ReNWordSymb, // \W
|
||||
ReWSpace, // \s
|
||||
ReNWSpace, // \S
|
||||
ReUCase, // \u
|
||||
ReNUCase , // \l
|
||||
ReWBound, // \b
|
||||
ReNWBound, // \B
|
||||
RePreNW, // \c
|
||||
ReStart, // \m
|
||||
ReEnd, // \M
|
||||
|
||||
ReChr = 0x0 // Char in Lower Byte
|
||||
};
|
||||
enum ETempSymb
|
||||
{
|
||||
ReTemp = 0x7000,
|
||||
ReLBrack, ReRBrack,
|
||||
ReEnumS, ReEnumE, ReNEnumS,
|
||||
ReRangeS, ReRangeE, ReNGRangeE, ReFrToEnum
|
||||
};
|
||||
|
||||
#define BackSlash '\\'
|
||||
|
||||
typedef union SCharData
|
||||
{
|
||||
int IArr[8];
|
||||
char CArr[32];
|
||||
void SetBit(unsigned char Bit);
|
||||
void ClearBit(unsigned char Bit);
|
||||
bool GetBit(unsigned char Bit);
|
||||
} *PCharData;
|
||||
|
||||
typedef struct SRegInfo
|
||||
{
|
||||
SRegInfo();
|
||||
~SRegInfo();
|
||||
|
||||
EOps Op;
|
||||
union{
|
||||
SRegInfo *Param;
|
||||
int Symb;
|
||||
PCharData ChrClass;
|
||||
}un;
|
||||
int s,e;
|
||||
SRegInfo *Parent;
|
||||
SRegInfo *Next;
|
||||
} *PRegInfo;
|
||||
|
||||
typedef struct SMatches
|
||||
{
|
||||
int s[MatchesNum];
|
||||
int e[MatchesNum];
|
||||
int CurMatch;
|
||||
} *PMatches;
|
||||
|
||||
typedef class PosRegExp
|
||||
{
|
||||
PRegInfo Info;
|
||||
PMatches BkTrace;
|
||||
bool NoCase,Extend,NoMoves;
|
||||
bool Error;
|
||||
int *Exprn;
|
||||
int posParse;
|
||||
int posEnd,posStart;
|
||||
int posBkStr;
|
||||
int FirstChar;
|
||||
|
||||
bool SetExprLow(const char *Expr);
|
||||
bool SetStructs(PRegInfo &Info,int st,int end);
|
||||
void Optimize();
|
||||
bool CheckSymb(int Symb,bool Inc);
|
||||
bool LowParse(PRegInfo Re);
|
||||
bool LowParseRe(PRegInfo &Next);
|
||||
bool LowCheckNext(PRegInfo Re);
|
||||
bool ParseRe(int posStr);
|
||||
bool QuickCheck();
|
||||
public:
|
||||
PMatches Matches;
|
||||
int Ok, CurMatch;
|
||||
|
||||
void *param;
|
||||
char (*CharAt)(int pos, void *param);
|
||||
|
||||
PosRegExp();
|
||||
~PosRegExp();
|
||||
|
||||
bool isok();
|
||||
bool SetNoMoves(bool Moves);
|
||||
bool SetBkTrace(int posStr,PMatches Trace);
|
||||
bool SetExpr(const char *Expr);
|
||||
bool Parse(int posStr, int posStop, PMatches Mtch);
|
||||
bool Parse(int posStr,int posSol, int posEol, PMatches Mtch, int Moves = -1);
|
||||
bool Evaluate(char *Expr, int posStr, PMatches Mtch, char **Res);
|
||||
} *PPosRegExp;
|
||||
|
||||
#endif /* POSREGEXP_H */
|
46
contrib/src/stc/scintilla/include/ScintillaWidget.h
Normal file
46
contrib/src/stc/scintilla/include/ScintillaWidget.h
Normal file
@@ -0,0 +1,46 @@
|
||||
// Scintilla source code edit control
|
||||
// ScintillaWidget.h - definition of Scintilla widget for GTK+
|
||||
// Only needed by GTK+ code but is harmless on other platforms.
|
||||
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifndef SCINTILLAWIDGET_H
|
||||
#define SCINTILLAWIDGET_H
|
||||
|
||||
#if PLAT_GTK
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SCINTILLA(obj) GTK_CHECK_CAST (obj, scintilla_get_type (), ScintillaObject)
|
||||
#define SCINTILLA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
|
||||
#define IS_SCINTILLA(obj) GTK_CHECK_TYPE (obj, scintilla_get_type ())
|
||||
|
||||
typedef struct _ScintillaObject ScintillaObject;
|
||||
typedef struct _ScintillaClass ScintillaClass;
|
||||
|
||||
struct _ScintillaObject {
|
||||
GtkFixed vbox;
|
||||
void *pscin;
|
||||
};
|
||||
|
||||
struct _ScintillaClass {
|
||||
GtkFixedClass parent_class;
|
||||
|
||||
void (* command) (ScintillaObject *ttt);
|
||||
void (* notify) (ScintillaObject *ttt);
|
||||
};
|
||||
|
||||
guint scintilla_get_type (void);
|
||||
GtkWidget* scintilla_new (void);
|
||||
void scintilla_set_id (ScintillaObject *sci,int id);
|
||||
long scintilla_send_message (ScintillaObject *sci,int iMessage,int wParam,int lParam);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
298
contrib/src/stc/scintilla/src/LexLua.cxx
Normal file
298
contrib/src/stc/scintilla/src/LexLua.cxx
Normal file
@@ -0,0 +1,298 @@
|
||||
// LexLua.cxx - lexer for Lua language
|
||||
// Written by Paul Winwood
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
static void classifyWordLua(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler)
|
||||
{
|
||||
char s[100];
|
||||
bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.');
|
||||
|
||||
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++)
|
||||
{
|
||||
s[i] = styler[start + i];
|
||||
s[i + 1] = '\0';
|
||||
}
|
||||
|
||||
char chAttr = SCE_LUA_IDENTIFIER;
|
||||
|
||||
if (wordIsNumber)
|
||||
chAttr = SCE_LUA_NUMBER;
|
||||
else
|
||||
{
|
||||
if (keywords.InList(s))
|
||||
{
|
||||
chAttr = SCE_LUA_WORD;
|
||||
}
|
||||
}
|
||||
styler.ColourTo(end, chAttr);
|
||||
}
|
||||
|
||||
static void ColouriseLuaDoc(unsigned int startPos,
|
||||
int length,
|
||||
int initStyle,
|
||||
WordList *keywordlists[],
|
||||
Accessor &styler)
|
||||
{
|
||||
|
||||
WordList &keywords = *keywordlists[0];
|
||||
|
||||
styler.StartAt(startPos);
|
||||
styler.GetLine(startPos);
|
||||
|
||||
int state = initStyle;
|
||||
char chPrev = ' ';
|
||||
char chNext = styler[startPos];
|
||||
unsigned int lengthDoc = startPos + length;
|
||||
bool firstChar = true;
|
||||
int literalString = 0;
|
||||
|
||||
styler.StartSegment(startPos);
|
||||
for (unsigned int i = startPos; i <= lengthDoc; i++)
|
||||
{
|
||||
char ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
|
||||
if (styler.IsLeadByte(ch))
|
||||
{
|
||||
chNext = styler.SafeGetCharAt(i + 2);
|
||||
chPrev = ' ';
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state == SCE_LUA_STRINGEOL)
|
||||
{
|
||||
if (ch != '\r' && ch != '\n')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
if (state == SCE_LUA_LITERALSTRING && ch == '[' && chNext == '[')
|
||||
{
|
||||
literalString++;
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_DEFAULT)
|
||||
{
|
||||
if (ch == '-' && chNext == '-')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_COMMENTLINE;
|
||||
}
|
||||
else
|
||||
if (ch == '[' && chNext == '[')
|
||||
{
|
||||
state = SCE_LUA_LITERALSTRING;
|
||||
literalString = 1;
|
||||
}
|
||||
else
|
||||
if (iswordstart(ch))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_WORD;
|
||||
}
|
||||
else
|
||||
if (ch == '\"')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_STRING;
|
||||
}
|
||||
else
|
||||
if (ch == '\'')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_CHARACTER;
|
||||
}
|
||||
else
|
||||
if (ch == '$' && firstChar)
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_PREPROCESSOR;
|
||||
}
|
||||
else
|
||||
if (isoperator(ch))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
styler.ColourTo(i, SCE_LUA_OPERATOR);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_WORD)
|
||||
{
|
||||
if (!iswordchar(ch))
|
||||
{
|
||||
classifyWordLua(styler.GetStartSegment(), i - 1, keywords, styler);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
if (ch == '[' && chNext == '[')
|
||||
{
|
||||
literalString = 1;
|
||||
state = SCE_LUA_LITERALSTRING;
|
||||
}
|
||||
else
|
||||
if (ch == '-' && chNext == '-')
|
||||
{
|
||||
state = SCE_LUA_COMMENTLINE;
|
||||
}
|
||||
else
|
||||
if (ch == '\"')
|
||||
{
|
||||
state = SCE_LUA_STRING;
|
||||
}
|
||||
else
|
||||
if (ch == '\'')
|
||||
{
|
||||
state = SCE_LUA_CHARACTER;
|
||||
}
|
||||
else
|
||||
if (ch == '$' && firstChar)
|
||||
{
|
||||
state = SCE_LUA_PREPROCESSOR;
|
||||
}
|
||||
else
|
||||
if (isoperator(ch))
|
||||
{
|
||||
styler.ColourTo(i, SCE_LUA_OPERATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (state == SCE_LUA_LITERALSTRING)
|
||||
{
|
||||
if (ch == ']' && (chPrev == ']') && (--literalString == 0))
|
||||
{
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_PREPROCESSOR)
|
||||
{
|
||||
if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_COMMENTLINE)
|
||||
{
|
||||
if (ch == '\r' || ch == '\n')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_STRING)
|
||||
{
|
||||
if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_STRINGEOL;
|
||||
}
|
||||
else
|
||||
if (ch == '\\')
|
||||
{
|
||||
if (chNext == '\"' || chNext == '\\')
|
||||
{
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (ch == '\"')
|
||||
{
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_CHARACTER)
|
||||
{
|
||||
if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_STRINGEOL;
|
||||
}
|
||||
else
|
||||
if (ch == '\\')
|
||||
{
|
||||
if (chNext == '\'' || chNext == '\\')
|
||||
{
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (ch == '\'')
|
||||
{
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (state == SCE_LUA_DEFAULT)
|
||||
{
|
||||
if (ch == '-' && chNext == '-')
|
||||
{
|
||||
state = SCE_LUA_COMMENTLINE;
|
||||
}
|
||||
else
|
||||
if (ch == '\"')
|
||||
{
|
||||
state = SCE_LUA_STRING;
|
||||
}
|
||||
else
|
||||
if (ch == '\'')
|
||||
{
|
||||
state = SCE_LUA_CHARACTER;
|
||||
}
|
||||
else
|
||||
if (ch == '$' && firstChar)
|
||||
{
|
||||
state = SCE_LUA_PREPROCESSOR;
|
||||
}
|
||||
else
|
||||
if (iswordstart(ch))
|
||||
{
|
||||
state = SCE_LUA_WORD;
|
||||
}
|
||||
else
|
||||
if (isoperator(ch))
|
||||
{
|
||||
styler.ColourTo(i, SCE_LUA_OPERATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
chPrev = ch;
|
||||
firstChar = (ch == '\r' || ch == '\n');
|
||||
}
|
||||
styler.ColourTo(lengthDoc - 1, state);
|
||||
}
|
||||
|
||||
LexerModule lmLua(SCLEX_LUA, ColouriseLuaDoc);
|
1181
contrib/src/stc/scintilla/src/PosRegExp.cxx
Normal file
1181
contrib/src/stc/scintilla/src/PosRegExp.cxx
Normal file
File diff suppressed because it is too large
Load Diff
138
src/stc/scintilla/include/PosRegExp.h
Normal file
138
src/stc/scintilla/include/PosRegExp.h
Normal file
@@ -0,0 +1,138 @@
|
||||
#ifndef POSREGEXP_H
|
||||
#define POSREGEXP_H
|
||||
|
||||
#define MatchesNum 0x10
|
||||
|
||||
enum EOps
|
||||
{
|
||||
ReBlockOps = 0x1000,
|
||||
ReMul, // *
|
||||
RePlus, // +
|
||||
ReQuest, // ?
|
||||
ReNGMul, // *?
|
||||
ReNGPlus, // +?
|
||||
ReNGQuest, // ??
|
||||
ReRangeN, // {n,}
|
||||
ReRangeNM, // {n,m}
|
||||
ReNGRangeN, // {n,}?
|
||||
ReNGRangeNM, // {n,m}?
|
||||
ReOr, // |
|
||||
ReBehind = 0x1100, // ?#n
|
||||
ReNBehind = 0x1200, // ?~n
|
||||
ReAhead = 0x1300, // ?=
|
||||
ReNAhead = 0x1400, // ?!
|
||||
|
||||
ReSymbolOps = 0x2000,
|
||||
ReEmpty,
|
||||
ReSymb, // a b \W \s ...
|
||||
ReEnum, // []
|
||||
ReNEnum, // [^]
|
||||
ReBrackets, // (...)
|
||||
ReBkTrace = 0x2100, // \yN
|
||||
ReBkBrack = 0x2200 // \N
|
||||
};
|
||||
|
||||
enum ESymbols
|
||||
{
|
||||
ReAnyChr = 0x4000, // .
|
||||
ReSoL, // ^
|
||||
ReEoL, // $
|
||||
ReDigit, // \d
|
||||
ReNDigit, // \D
|
||||
ReWordSymb, // \w
|
||||
ReNWordSymb, // \W
|
||||
ReWSpace, // \s
|
||||
ReNWSpace, // \S
|
||||
ReUCase, // \u
|
||||
ReNUCase , // \l
|
||||
ReWBound, // \b
|
||||
ReNWBound, // \B
|
||||
RePreNW, // \c
|
||||
ReStart, // \m
|
||||
ReEnd, // \M
|
||||
|
||||
ReChr = 0x0 // Char in Lower Byte
|
||||
};
|
||||
enum ETempSymb
|
||||
{
|
||||
ReTemp = 0x7000,
|
||||
ReLBrack, ReRBrack,
|
||||
ReEnumS, ReEnumE, ReNEnumS,
|
||||
ReRangeS, ReRangeE, ReNGRangeE, ReFrToEnum
|
||||
};
|
||||
|
||||
#define BackSlash '\\'
|
||||
|
||||
typedef union SCharData
|
||||
{
|
||||
int IArr[8];
|
||||
char CArr[32];
|
||||
void SetBit(unsigned char Bit);
|
||||
void ClearBit(unsigned char Bit);
|
||||
bool GetBit(unsigned char Bit);
|
||||
} *PCharData;
|
||||
|
||||
typedef struct SRegInfo
|
||||
{
|
||||
SRegInfo();
|
||||
~SRegInfo();
|
||||
|
||||
EOps Op;
|
||||
union{
|
||||
SRegInfo *Param;
|
||||
int Symb;
|
||||
PCharData ChrClass;
|
||||
}un;
|
||||
int s,e;
|
||||
SRegInfo *Parent;
|
||||
SRegInfo *Next;
|
||||
} *PRegInfo;
|
||||
|
||||
typedef struct SMatches
|
||||
{
|
||||
int s[MatchesNum];
|
||||
int e[MatchesNum];
|
||||
int CurMatch;
|
||||
} *PMatches;
|
||||
|
||||
typedef class PosRegExp
|
||||
{
|
||||
PRegInfo Info;
|
||||
PMatches BkTrace;
|
||||
bool NoCase,Extend,NoMoves;
|
||||
bool Error;
|
||||
int *Exprn;
|
||||
int posParse;
|
||||
int posEnd,posStart;
|
||||
int posBkStr;
|
||||
int FirstChar;
|
||||
|
||||
bool SetExprLow(const char *Expr);
|
||||
bool SetStructs(PRegInfo &Info,int st,int end);
|
||||
void Optimize();
|
||||
bool CheckSymb(int Symb,bool Inc);
|
||||
bool LowParse(PRegInfo Re);
|
||||
bool LowParseRe(PRegInfo &Next);
|
||||
bool LowCheckNext(PRegInfo Re);
|
||||
bool ParseRe(int posStr);
|
||||
bool QuickCheck();
|
||||
public:
|
||||
PMatches Matches;
|
||||
int Ok, CurMatch;
|
||||
|
||||
void *param;
|
||||
char (*CharAt)(int pos, void *param);
|
||||
|
||||
PosRegExp();
|
||||
~PosRegExp();
|
||||
|
||||
bool isok();
|
||||
bool SetNoMoves(bool Moves);
|
||||
bool SetBkTrace(int posStr,PMatches Trace);
|
||||
bool SetExpr(const char *Expr);
|
||||
bool Parse(int posStr, int posStop, PMatches Mtch);
|
||||
bool Parse(int posStr,int posSol, int posEol, PMatches Mtch, int Moves = -1);
|
||||
bool Evaluate(char *Expr, int posStr, PMatches Mtch, char **Res);
|
||||
} *PPosRegExp;
|
||||
|
||||
#endif /* POSREGEXP_H */
|
46
src/stc/scintilla/include/ScintillaWidget.h
Normal file
46
src/stc/scintilla/include/ScintillaWidget.h
Normal file
@@ -0,0 +1,46 @@
|
||||
// Scintilla source code edit control
|
||||
// ScintillaWidget.h - definition of Scintilla widget for GTK+
|
||||
// Only needed by GTK+ code but is harmless on other platforms.
|
||||
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifndef SCINTILLAWIDGET_H
|
||||
#define SCINTILLAWIDGET_H
|
||||
|
||||
#if PLAT_GTK
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SCINTILLA(obj) GTK_CHECK_CAST (obj, scintilla_get_type (), ScintillaObject)
|
||||
#define SCINTILLA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
|
||||
#define IS_SCINTILLA(obj) GTK_CHECK_TYPE (obj, scintilla_get_type ())
|
||||
|
||||
typedef struct _ScintillaObject ScintillaObject;
|
||||
typedef struct _ScintillaClass ScintillaClass;
|
||||
|
||||
struct _ScintillaObject {
|
||||
GtkFixed vbox;
|
||||
void *pscin;
|
||||
};
|
||||
|
||||
struct _ScintillaClass {
|
||||
GtkFixedClass parent_class;
|
||||
|
||||
void (* command) (ScintillaObject *ttt);
|
||||
void (* notify) (ScintillaObject *ttt);
|
||||
};
|
||||
|
||||
guint scintilla_get_type (void);
|
||||
GtkWidget* scintilla_new (void);
|
||||
void scintilla_set_id (ScintillaObject *sci,int id);
|
||||
long scintilla_send_message (ScintillaObject *sci,int iMessage,int wParam,int lParam);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
298
src/stc/scintilla/src/LexLua.cxx
Normal file
298
src/stc/scintilla/src/LexLua.cxx
Normal file
@@ -0,0 +1,298 @@
|
||||
// LexLua.cxx - lexer for Lua language
|
||||
// Written by Paul Winwood
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#include "PropSet.h"
|
||||
#include "Accessor.h"
|
||||
#include "KeyWords.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
||||
static void classifyWordLua(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler)
|
||||
{
|
||||
char s[100];
|
||||
bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.');
|
||||
|
||||
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++)
|
||||
{
|
||||
s[i] = styler[start + i];
|
||||
s[i + 1] = '\0';
|
||||
}
|
||||
|
||||
char chAttr = SCE_LUA_IDENTIFIER;
|
||||
|
||||
if (wordIsNumber)
|
||||
chAttr = SCE_LUA_NUMBER;
|
||||
else
|
||||
{
|
||||
if (keywords.InList(s))
|
||||
{
|
||||
chAttr = SCE_LUA_WORD;
|
||||
}
|
||||
}
|
||||
styler.ColourTo(end, chAttr);
|
||||
}
|
||||
|
||||
static void ColouriseLuaDoc(unsigned int startPos,
|
||||
int length,
|
||||
int initStyle,
|
||||
WordList *keywordlists[],
|
||||
Accessor &styler)
|
||||
{
|
||||
|
||||
WordList &keywords = *keywordlists[0];
|
||||
|
||||
styler.StartAt(startPos);
|
||||
styler.GetLine(startPos);
|
||||
|
||||
int state = initStyle;
|
||||
char chPrev = ' ';
|
||||
char chNext = styler[startPos];
|
||||
unsigned int lengthDoc = startPos + length;
|
||||
bool firstChar = true;
|
||||
int literalString = 0;
|
||||
|
||||
styler.StartSegment(startPos);
|
||||
for (unsigned int i = startPos; i <= lengthDoc; i++)
|
||||
{
|
||||
char ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
|
||||
if (styler.IsLeadByte(ch))
|
||||
{
|
||||
chNext = styler.SafeGetCharAt(i + 2);
|
||||
chPrev = ' ';
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state == SCE_LUA_STRINGEOL)
|
||||
{
|
||||
if (ch != '\r' && ch != '\n')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
if (state == SCE_LUA_LITERALSTRING && ch == '[' && chNext == '[')
|
||||
{
|
||||
literalString++;
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_DEFAULT)
|
||||
{
|
||||
if (ch == '-' && chNext == '-')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_COMMENTLINE;
|
||||
}
|
||||
else
|
||||
if (ch == '[' && chNext == '[')
|
||||
{
|
||||
state = SCE_LUA_LITERALSTRING;
|
||||
literalString = 1;
|
||||
}
|
||||
else
|
||||
if (iswordstart(ch))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_WORD;
|
||||
}
|
||||
else
|
||||
if (ch == '\"')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_STRING;
|
||||
}
|
||||
else
|
||||
if (ch == '\'')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_CHARACTER;
|
||||
}
|
||||
else
|
||||
if (ch == '$' && firstChar)
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_PREPROCESSOR;
|
||||
}
|
||||
else
|
||||
if (isoperator(ch))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
styler.ColourTo(i, SCE_LUA_OPERATOR);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_WORD)
|
||||
{
|
||||
if (!iswordchar(ch))
|
||||
{
|
||||
classifyWordLua(styler.GetStartSegment(), i - 1, keywords, styler);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
if (ch == '[' && chNext == '[')
|
||||
{
|
||||
literalString = 1;
|
||||
state = SCE_LUA_LITERALSTRING;
|
||||
}
|
||||
else
|
||||
if (ch == '-' && chNext == '-')
|
||||
{
|
||||
state = SCE_LUA_COMMENTLINE;
|
||||
}
|
||||
else
|
||||
if (ch == '\"')
|
||||
{
|
||||
state = SCE_LUA_STRING;
|
||||
}
|
||||
else
|
||||
if (ch == '\'')
|
||||
{
|
||||
state = SCE_LUA_CHARACTER;
|
||||
}
|
||||
else
|
||||
if (ch == '$' && firstChar)
|
||||
{
|
||||
state = SCE_LUA_PREPROCESSOR;
|
||||
}
|
||||
else
|
||||
if (isoperator(ch))
|
||||
{
|
||||
styler.ColourTo(i, SCE_LUA_OPERATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (state == SCE_LUA_LITERALSTRING)
|
||||
{
|
||||
if (ch == ']' && (chPrev == ']') && (--literalString == 0))
|
||||
{
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_PREPROCESSOR)
|
||||
{
|
||||
if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_COMMENTLINE)
|
||||
{
|
||||
if (ch == '\r' || ch == '\n')
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_STRING)
|
||||
{
|
||||
if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_STRINGEOL;
|
||||
}
|
||||
else
|
||||
if (ch == '\\')
|
||||
{
|
||||
if (chNext == '\"' || chNext == '\\')
|
||||
{
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (ch == '\"')
|
||||
{
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (state == SCE_LUA_CHARACTER)
|
||||
{
|
||||
if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
|
||||
{
|
||||
styler.ColourTo(i-1, state);
|
||||
state = SCE_LUA_STRINGEOL;
|
||||
}
|
||||
else
|
||||
if (ch == '\\')
|
||||
{
|
||||
if (chNext == '\'' || chNext == '\\')
|
||||
{
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (ch == '\'')
|
||||
{
|
||||
styler.ColourTo(i, state);
|
||||
state = SCE_LUA_DEFAULT;
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = styler.SafeGetCharAt(i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (state == SCE_LUA_DEFAULT)
|
||||
{
|
||||
if (ch == '-' && chNext == '-')
|
||||
{
|
||||
state = SCE_LUA_COMMENTLINE;
|
||||
}
|
||||
else
|
||||
if (ch == '\"')
|
||||
{
|
||||
state = SCE_LUA_STRING;
|
||||
}
|
||||
else
|
||||
if (ch == '\'')
|
||||
{
|
||||
state = SCE_LUA_CHARACTER;
|
||||
}
|
||||
else
|
||||
if (ch == '$' && firstChar)
|
||||
{
|
||||
state = SCE_LUA_PREPROCESSOR;
|
||||
}
|
||||
else
|
||||
if (iswordstart(ch))
|
||||
{
|
||||
state = SCE_LUA_WORD;
|
||||
}
|
||||
else
|
||||
if (isoperator(ch))
|
||||
{
|
||||
styler.ColourTo(i, SCE_LUA_OPERATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
chPrev = ch;
|
||||
firstChar = (ch == '\r' || ch == '\n');
|
||||
}
|
||||
styler.ColourTo(lengthDoc - 1, state);
|
||||
}
|
||||
|
||||
LexerModule lmLua(SCLEX_LUA, ColouriseLuaDoc);
|
1181
src/stc/scintilla/src/PosRegExp.cxx
Normal file
1181
src/stc/scintilla/src/PosRegExp.cxx
Normal file
File diff suppressed because it is too large
Load Diff
29
utils/HelpGen/src/HelpGenVC.dsw
Normal file
29
utils/HelpGen/src/HelpGenVC.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "HelpGenVC"=.\HelpGenVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
Reference in New Issue
Block a user