BOOL bRedefineBlock = TRUE;
BOOL bDecIndex = FALSE;
int nIdentBegin = -1;
- for (int I = 0;; I++)
+ int nPrevI = -1;
+ for (int I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
if (bRedefineBlock)
{
int nPos = I;
if (bDecIndex)
- nPos--;
+ nPos = nPrevI;
if (dwCookie & (COOKIE_COMMENT | COOKIE_EXT_COMMENT))
{
DEFINE_BLOCK (nPos, COLORINDEX_COMMENT);
// String constant "...."
if (dwCookie & COOKIE_STRING)
{
- if (pszChars[I] == '"' && (I == 0 || I == 1 && pszChars[I - 1] != '\\' || I >= 2 && (pszChars[I - 1] != '\\' || pszChars[I - 1] == '\\' && pszChars[I - 2] == '\\')))
+ if (pszChars[I] == '"' && (I == 0 || I == 1 && pszChars[nPrevI] != '\\' || I >= 2 && (pszChars[nPrevI] != '\\' || pszChars[nPrevI] == '\\' && *::CharPrev(pszChars, pszChars + nPrevI) == '\\')))
{
dwCookie &= ~COOKIE_STRING;
bRedefineBlock = TRUE;
// Char constant '..'
if (dwCookie & COOKIE_CHAR)
{
- if (pszChars[I] == '\'' && (I == 0 || I == 1 && pszChars[I - 1] != '\\' || I >= 2 && (pszChars[I - 1] != '\\' || pszChars[I - 1] == '\\' && pszChars[I - 2] == '\\')))
+ if (pszChars[I] == '\'' && (I == 0 || I == 1 && pszChars[nPrevI] != '\\' || I >= 2 && (pszChars[nPrevI] != '\\' || pszChars[nPrevI] == '\\' && *::CharPrev(pszChars, pszChars + nPrevI) == '\\')))
{
dwCookie &= ~COOKIE_CHAR;
bRedefineBlock = TRUE;
{
if (!(dwCookie & COOKIE_EXT_USER1))
{
- if (I > 1 && pszChars[I] == '>' && pszChars[I - 1] == '-' && pszChars[I - 2] == '-')
+ if (I > 1 && pszChars[I] == '>' && pszChars[nPrevI] == '-' && *::CharPrev(pszChars, pszChars + nPrevI) == '-')
{
dwCookie &= ~COOKIE_EXT_COMMENT;
bRedefineBlock = TRUE;
// Extended comment <?....?>
if (dwCookie & COOKIE_EXT_USER1)
{
- if (I > 0 && pszChars[I] == '>' && (pszChars[I - 1] == '?' || pszChars[I - 1] == '%'))
+ if (I > 0 && pszChars[I] == '>' && (pszChars[nPrevI] == '?' || pszChars[nPrevI] == '%'))
{
dwCookie &= ~COOKIE_EXT_USER1;
bRedefineBlock = TRUE;
if ((dwCookie & (COOKIE_PREPROCESSOR|COOKIE_EXT_USER1)) && pszChars[I] == '\'')
{
// if (I + 1 < nLength && pszChars[I + 1] == '\'' || I + 2 < nLength && pszChars[I + 1] != '\\' && pszChars[I + 2] == '\'' || I + 3 < nLength && pszChars[I + 1] == '\\' && pszChars[I + 3] == '\'')
- if (!I || !xisalnum (pszChars[I - 1]))
+ if (!I || !xisalnum (pszChars[nPrevI]))
{
DEFINE_BLOCK (I, COLORINDEX_STRING);
dwCookie |= COOKIE_CHAR;
if (bFirstChar)
{
- if (!_istspace (pszChars[I]))
+ if (!xisspace (pszChars[I]))
bFirstChar = FALSE;
}
for (int j = I; j < nLength; j++)
{
- if (!_istspace (pszChars[j]))
+ if (!xisspace (pszChars[j]))
{
if (pszChars[j] == '(')
{
// User1 end: ?>
if (dwCookie & COOKIE_EXT_USER1)
{
- if (I > 0 && pszChars[I] == '>' && (pszChars[I - 1] == '?' || pszChars[I - 1] == '%'))
+ if (I > 0 && pszChars[I] == '>' && (pszChars[nPrevI] == '?' || pszChars[nPrevI] == '%'))
{
dwCookie &= ~COOKIE_EXT_USER1;
nIdentBegin = -1;
for (int j = I; j < nLength; j++)
{
- if (!_istspace (pszChars[j]))
+ if (!xisspace (pszChars[j]))
{
if (pszChars[j] == '(')
{
for (int j = I; j < nLength; j++)
{
- if (!_istspace (pszChars[j]))
+ if (!xisspace (pszChars[j]))
{
if (pszChars[j] == '(')
{
// User1 end: ?>
if (dwCookie & COOKIE_EXT_USER1)
{
- if (I > 0 && pszChars[I] == '>' && (pszChars[I - 1] == '?' || pszChars[I - 1] == '%'))
+ if (I > 0 && pszChars[I] == '>' && (pszChars[nPrevI] == '?' || pszChars[nPrevI] == '%'))
{
dwCookie &= ~COOKIE_EXT_USER1;
nIdentBegin = -1;
#include "stdafx.h"
#include "ccrystaltextview.h"
+#include "ccrystaltextbuffer.h"
#ifdef _DEBUG
#define new DEBUG_NEW
_T ("CStr"),
_T ("CVar"),
_T ("CurDir"),
+ _T ("Currency"),
_T ("Date"),
_T ("Declare"),
_T ("Dialog"),
_T ("Erase"),
_T ("Exit"),
_T ("Exp"),
+ _T ("Explicit"),
_T ("False"),
_T ("FileCopy"),
_T ("FileLen"),
_T ("Step"),
_T ("Next"),
_T ("Format"),
+ _T ("Friend"),
_T ("Function"),
_T ("Get"),
_T ("GetObject"),
_T ("Hex"),
_T ("Hour"),
_T ("If"),
+ _T ("In"),
_T ("Then"),
_T ("Else"),
_T ("ElseIf"),
_T ("Left$"),
_T ("Len"),
_T ("Let"),
+ _T ("Like"),
_T ("Lib"),
_T ("Line"),
_T ("Input#"),
_T ("Optional"),
_T ("Base"),
_T ("Print"),
+ _T ("Private"),
+ _T ("Property"),
_T ("Public"),
_T ("Private"),
_T ("Property"),
BOOL bRedefineBlock = TRUE;
BOOL bDecIndex = FALSE;
int nIdentBegin = -1;
- for (int I = 0;; I++)
+ int nPrevI = -1;
+ for (int I = 0;; nPrevI = I, I = ::CharNext(pszChars+I) - pszChars)
{
if (bRedefineBlock)
{
int nPos = I;
if (bDecIndex)
- nPos--;
+ nPos = nPrevI;
if (dwCookie & (COOKIE_COMMENT | COOKIE_EXT_COMMENT))
{
DEFINE_BLOCK (nPos, COLORINDEX_COMMENT);
}
else
{
- if (xisalnum (pszChars[nPos]) || pszChars[nPos] == '.' && nPos > 0 && (!xisalpha (pszChars[nPos - 1]) && !xisalpha (pszChars[nPos + 1])))
+ if (xisalnum (pszChars[nPos]) || pszChars[nPos] == '.' && nPos > 0 && (!xisalpha (*::CharPrev(pszChars, pszChars + nPos)) && !xisalpha (*::CharNext(pszChars + nPos))))
{
DEFINE_BLOCK (nPos, COLORINDEX_NORMALTEXT);
}
// String constant "...."
if (dwCookie & COOKIE_STRING)
{
- if (pszChars[I] == '"')
+ if (pszChars[I] == '"' && (I == 0 || I == 1 && pszChars[nPrevI] != '\\' || I >= 2 && (pszChars[nPrevI] != '\\' || pszChars[nPrevI] == '\\' && *::CharPrev(pszChars, pszChars + nPrevI) == '\\')))
{
dwCookie &= ~COOKIE_STRING;
bRedefineBlock = TRUE;
// Char constant '..'
if (dwCookie & COOKIE_CHAR)
{
- if (pszChars[I] == '\'' && (I == 0 || I == 1 && pszChars[I - 1] != '\\' || I >= 2 && (pszChars[I - 1] != '\\' || pszChars[I - 1] == '\\' && pszChars[I - 2] == '\\')))
+ if (pszChars[I] == '\'' && (I == 0 || I == 1 && pszChars[nPrevI] != '\\' || I >= 2 && (pszChars[nPrevI] != '\\' || pszChars[nPrevI] == '\\' && *::CharPrev(pszChars, pszChars + nPrevI) == '\\')))
{
dwCookie &= ~COOKIE_CHAR;
bRedefineBlock = TRUE;
if (pszChars[I] == '\'')
{
// if (I + 1 < nLength && pszChars[I + 1] == '\'' || I + 2 < nLength && pszChars[I + 1] != '\\' && pszChars[I + 2] == '\'' || I + 3 < nLength && pszChars[I + 1] == '\\' && pszChars[I + 3] == '\'')
- if (!I || !xisalnum (pszChars[I - 1]))
+ if (!I || !xisalnum (pszChars[nPrevI]))
{
DEFINE_BLOCK (I, COLORINDEX_STRING);
dwCookie |= COOKIE_CHAR;
continue;
}
}
- if (I > 2 && !xisalnum (pszChars[I]) && (pszChars[I - 1] == 'M' || pszChars[I - 1] == 'm') && (pszChars[I - 2] == 'E' || pszChars[I - 2] == 'e') && (pszChars[I - 3] == 'R' || pszChars[I - 3] == 'r'))
+ if (I > 2 && !xisalnum (pszChars[I]) && (pszChars[nPrevI] == 'M' || pszChars[nPrevI] == 'm') && (*::CharPrev(pszChars, pszChars + nPrevI) == 'E' || *::CharPrev(pszChars, pszChars + nPrevI) == 'e') && (pszChars[I - 3] == 'R' || pszChars[I - 3] == 'r'))
{
DEFINE_BLOCK (I - 3, COLORINDEX_COMMENT);
dwCookie |= COOKIE_COMMENT;
if (bFirstChar)
{
- if (!_istspace (pszChars[I]))
+ if (!xisspace (pszChars[I]))
bFirstChar = FALSE;
}
continue; // We don't need to extract keywords,
// for faster parsing skip the rest of loop
- if (xisalnum (pszChars[I]) || pszChars[I] == '.' && I > 0 && (!xisalpha (pszChars[I - 1]) && !xisalpha (pszChars[I + 1])))
+ if (xisalnum (pszChars[I]) || pszChars[I] == '.' && I > 0 && (!xisalpha (pszChars[nPrevI]) && !xisalpha (pszChars[I + 1])))
{
if (nIdentBegin == -1)
nIdentBegin = I;
for (int j = I; j < nLength; j++)
{
- if (!_istspace (pszChars[j]))
+ if (!xisspace (pszChars[j]))
{
if (pszChars[j] == '(')
{
for (int j = I; j < nLength; j++)
{
- if (!_istspace (pszChars[j]))
+ if (!xisspace (pszChars[j]))
{
if (pszChars[j] == '(')
{
}
}
- if (pszChars[nLength - 1] != '\\')
+ if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
dwCookie &= COOKIE_EXT_COMMENT;
return dwCookie;
}
Src/Languages/Spanish: MergeSpanish.rc
PATCH: [ 1157145 ] FileFilterHelper doesn't have boilerplate new redefinition
Src: FileFilterHelper.cpp
+ PATCH: [ 968285 ] DBCS fixes from Sawanaka
+ Applied asp & basic portions (there are many more)
+ editlib: asp.cpp basic.cpp
2005-03-04 Perry
PATCH: [ 1147039 ] experimental patch for colored word diff