X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9ce192d417eb9eb614bcf8510e91dac318706249..942285dcfa083d114cf519d15099ce204b9895e8:/src/stc/scintilla/include/KeyWords.h diff --git a/src/stc/scintilla/include/KeyWords.h b/src/stc/scintilla/include/KeyWords.h index 2cc03b788f..3159dcc1b4 100644 --- a/src/stc/scintilla/include/KeyWords.h +++ b/src/stc/scintilla/include/KeyWords.h @@ -3,6 +3,39 @@ // Copyright 1998-2000 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. -void ColouriseDoc(int codePage, int startPos, int lengthDoc, int initStyle, - int language, WordList *keywordlists[], StylingContext &styler); +typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler); + +class LexerModule { + static LexerModule *base; + LexerModule *next; + int language; + LexerFunction fn; +public: + LexerModule(int language_, LexerFunction fn_); + static void Colourise(unsigned int startPos, int lengthDoc, int initStyle, + int language, WordList *keywordlists[], Accessor &styler); +}; + +inline bool iswordchar(char ch) { + return isalnum(ch) || ch == '.' || ch == '_'; +} + +inline bool iswordstart(char ch) { + return isalnum(ch) || ch == '_'; +} + +inline bool isoperator(char ch) { + if (isalnum(ch)) + return false; + // '.' left out as it is used to make up numbers + if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || + ch == '(' || ch == ')' || ch == '-' || ch == '+' || + ch == '=' || ch == '|' || ch == '{' || ch == '}' || + ch == '[' || ch == ']' || ch == ':' || ch == ';' || + ch == '<' || ch == '>' || ch == ',' || ch == '/' || + ch == '?' || ch == '!' || ch == '.' || ch == '~') + return true; + return false; +}