3 #define ISXKEYWORD(keywordlist, key, keylen) CrystalLineParser::IsXKeyword(key, keylen, keywordlist, sizeof(keywordlist)/sizeof(keywordlist[0]), _tcsncmp)
\r
4 #define ISXKEYWORDI(keywordlist, key, keylen) CrystalLineParser::IsXKeyword(key, keylen, keywordlist, sizeof(keywordlist)/sizeof(keywordlist[0]), _tcsnicmp)
\r
6 #define DEFINE_BLOCK(pos, colorindex) \
\r
7 ASSERT((pos) >= 0 && (pos) <= nLength);\
\r
8 if (pBuf != nullptr)\
\r
10 if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
\r
11 if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
\r
12 if (nActualItems == 0 || pBuf[nActualItems - 1].m_nColorIndex != (colorindex)){\
\r
13 pBuf[nActualItems].m_nCharPos = (pos);\
\r
14 pBuf[nActualItems].m_nColorIndex = (colorindex);\
\r
15 pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
\r
19 #define COOKIE_COMMENT 0x0001
\r
20 #define COOKIE_PREPROCESSOR 0x0002
\r
21 #define COOKIE_ELEMENT 0x0002
\r
22 #define COOKIE_EXT_COMMENT 0x0004
\r
23 #define COOKIE_STRING 0x0008
\r
24 #define COOKIE_CHAR 0x0010
\r
25 #define COOKIE_USER1 0x0020
\r
26 #define COOKIE_EXT_USER1 0x0040
\r
27 #define COOKIE_BLOCK_STYLE 0x0080
\r
28 #define COOKIE_BLOCK_SCRIPT 0x0100
\r
29 #define COOKIE_SECTION 0x0080
\r
30 #define COOKIE_KEY 0x0100
\r
31 #define COOKIE_EXT_COMMENT2 0x0200
\r
32 #define COOKIE_USER2 0x0400
\r
33 #define COOKIE_VARIABLE 0x0800
\r
34 #define COOKIE_RAWSTRING 0x1000
\r
35 #define COOKIE_EXT_DEFINITION 0x2000
\r
36 #define COOKIE_EXT_VALUE 0x4000
\r
38 #define COOKIE_GET_EXT_COMMENT_DEPTH(cookie) (((cookie) & 0x0F000000) >> 24)
\r
39 #define COOKIE_SET_EXT_COMMENT_DEPTH(cookie, depth) (cookie) = (((cookie) & 0xF0FFFFFF) | ((depth) << 24))
\r
40 #define COOKIE_GET_RAWSTRING_NUMBER_COUNT(cookie) (((cookie) & 0xF0000000) >> 28)
\r
41 #define COOKIE_SET_RAWSTRING_NUMBER_COUNT(cookie, count) (cookie) = (((cookie) & 0x0FFFFFFF) | ((count) << 28))
\r
42 #define COOKIE_GET_LUA_EQUALS_SIGN_COUNT(cookie) (((cookie) & 0xF0000000) >> 28)
\r
43 #define COOKIE_SET_LUA_EQUALS_SIGN_COUNT(cookie, count) (cookie) = (((cookie) & 0x0FFFFFFF) | ((count) << 28))
\r
45 #define SRCOPT_INSERTTABS 1
\r
46 #define SRCOPT_SHOWTABS 2
\r
47 #define SRCOPT_BSATBOL 4
\r
48 #define SRCOPT_SELMARGIN 8
\r
49 #define SRCOPT_AUTOINDENT 16
\r
50 #define SRCOPT_BRACEANSI 32
\r
51 #define SRCOPT_BRACEGNU 64
\r
52 #define SRCOPT_EOLNDOS 128
\r
53 #define SRCOPT_EOLNUNIX 256
\r
54 #define SRCOPT_EOLNMAC 512
\r
55 #define SRCOPT_FNBRACE 1024
\r
56 #define SRCOPT_WORDWRAP 2048
\r
57 #define SRCOPT_TOPMARGIN 4096
\r
59 namespace CrystalLineParser
\r
61 // Syntax coloring overrides
\r
66 int m_nBgColorIndex;
\r
115 // Tabsize is commented out since we have only GUI setting for it now.
\r
116 // Not removed because we may later want to have per-filetype settings again.
\r
117 // See ccrystaltextview.cpp for per filetype table initialization.
\r
118 struct TextDefinition
\r
123 unsigned (* ParseLineX) (unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
125 // unsigned tabsize;
\r
126 TCHAR opencomment[8];
\r
127 TCHAR closecomment[8];
\r
128 TCHAR commentline[8];
\r
132 extern TextDefinition m_SourceDefs[41];
\r
134 bool IsXKeyword(const TCHAR *pszKey, size_t nKeyLen, const TCHAR *pszKeywordList[], size_t nKeywordListCount, int(*compare)(const TCHAR *, const TCHAR *, size_t));
\r
135 bool IsXNumber(const TCHAR* pszChars, int nLength);
\r
136 bool IsHtmlKeyword(const TCHAR *pszChars, int nLength);
\r
137 bool IsHtmlUser1Keyword(const TCHAR *pszChars, int nLength);
\r
138 bool IsHtmlUser2Keyword(const TCHAR *pszChars, int nLength);
\r
140 TextDefinition *GetTextType(const TCHAR *pszExt);
\r
141 TextDefinition* GetTextType(int index);
\r
142 void SetExtension(int index, const TCHAR *pszExts);
\r
144 unsigned ParseLinePlain(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
145 unsigned ParseLineAsp(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
146 unsigned ParseLineAutoIt(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
147 unsigned ParseLineBasic(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
148 unsigned ParseLineBatch(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
149 unsigned ParseLineC(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
150 unsigned ParseLineCJava(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems, bool (*IsKeyword)(const TCHAR *pszChars, int nLength), bool (*IsUser1Keyword)(const TCHAR *pszChars, int nLength));
\r
151 unsigned ParseLineCSharp(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
152 unsigned ParseLineCss(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
153 unsigned ParseLineDcl(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
154 unsigned ParseLineFortran(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
155 unsigned ParseLineGo(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
156 unsigned ParseLineHtml(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
157 unsigned ParseLineHtmlEx(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems, int nEmbeddedLanguage);
\r
158 unsigned ParseLineIni(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
159 unsigned ParseLineInnoSetup(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
160 unsigned ParseLineIS(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
161 unsigned ParseLineJava(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
162 unsigned ParseLineJavaScript(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
163 unsigned ParseLineLisp(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
164 unsigned ParseLineLua(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
165 unsigned ParseLineNsis(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
166 unsigned ParseLinePascal(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
167 unsigned ParseLinePerl(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
168 unsigned ParseLinePhp(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
169 unsigned ParseLinePhpLanguage(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
170 unsigned ParseLinePo(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
171 unsigned ParseLinePowerShell(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
172 unsigned ParseLinePython(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
173 unsigned ParseLineRexx(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
174 unsigned ParseLineRsrc(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
175 unsigned ParseLineRuby(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
176 unsigned ParseLineRust(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
177 unsigned ParseLineSgml(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
178 unsigned ParseLineSh(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
179 unsigned ParseLineSiod(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
180 unsigned ParseLineSmarty(unsigned dwCookie, const TCHAR* pszChars, int nLength, TEXTBLOCK* pBuf, int& nActualItems);
\r
181 unsigned ParseLineSmartyLanguage(unsigned dwCookie, const TCHAR* pszChars, int nLength, TEXTBLOCK* pBuf, int& nActualItems);
\r
182 unsigned ParseLineSql(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
183 unsigned ParseLineTcl(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
184 unsigned ParseLineTex(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
185 unsigned ParseLineVerilog(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
186 unsigned ParseLineVhdl(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r
187 unsigned ParseLineXml(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
\r