summaryrefslogtreecommitdiffstats
path: root/scintilla
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2011-08-05 05:03:35 +0000
committerXhmikosR <xhmikosr@users.sourceforge.net>2011-08-05 05:03:35 +0000
commit0e3a0cdceeb2b352402dbd4dbf1f4a09a662b0da (patch)
tree37447f59056da6fb49d03ae233259e5e702c4b6e /scintilla
parentbe5f67f634cea827f7bdcce6fe2ddd8e03bddbc6 (diff)
downloadnotepad2-mod-0e3a0cdceeb2b352402dbd4dbf1f4a09a662b0da.zip
notepad2-mod-0e3a0cdceeb2b352402dbd4dbf1f4a09a662b0da.tar.gz
notepad2-mod-0e3a0cdceeb2b352402dbd4dbf1f4a09a662b0da.tar.bz2
update scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@565 28bd50df-7adb-d945-0439-6e466c6a13cc
Diffstat (limited to 'scintilla')
-rw-r--r--scintilla/include/SciLexer.h1
-rw-r--r--scintilla/include/Scintilla.iface1
-rw-r--r--scintilla/lexers/LexConf.cxx2
-rw-r--r--scintilla/lexers/LexLua.cxx82
-rw-r--r--scintilla/lexers/LexMagik.cxx2
-rw-r--r--scintilla/lexers/LexModula.cxx4
-rw-r--r--scintilla/lexers/LexPerl.cxx31
-rw-r--r--scintilla/lexers/LexPowerPro.cxx2
-rw-r--r--scintilla/lexers/LexTeX.cxx2
-rw-r--r--scintilla/lexers/LexVHDL.cxx2
10 files changed, 97 insertions, 32 deletions
diff --git a/scintilla/include/SciLexer.h b/scintilla/include/SciLexer.h
index 33dbd58..310b5a0 100644
--- a/scintilla/include/SciLexer.h
+++ b/scintilla/include/SciLexer.h
@@ -429,6 +429,7 @@
#define SCE_LUA_WORD6 17
#define SCE_LUA_WORD7 18
#define SCE_LUA_WORD8 19
+#define SCE_LUA_LABEL 20
#define SCE_ERR_DEFAULT 0
#define SCE_ERR_PYTHON 1
#define SCE_ERR_GCC 2
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface
index b8b63c2..11e844c 100644
--- a/scintilla/include/Scintilla.iface
+++ b/scintilla/include/Scintilla.iface
@@ -2782,6 +2782,7 @@ val SCE_LUA_WORD5=16
val SCE_LUA_WORD6=17
val SCE_LUA_WORD7=18
val SCE_LUA_WORD8=19
+val SCE_LUA_LABEL=20
# Lexical states for SCLEX_ERRORLIST
lex ErrorList=SCLEX_ERRORLIST SCE_ERR_
val SCE_ERR_DEFAULT=0
diff --git a/scintilla/lexers/LexConf.cxx b/scintilla/lexers/LexConf.cxx
index 0ead390..f26458b 100644
--- a/scintilla/lexers/LexConf.cxx
+++ b/scintilla/lexers/LexConf.cxx
@@ -2,7 +2,7 @@
/** @file LexConf.cxx
** Lexer for Apache Configuration Files.
**
- ** First working version contributed by Ahmad Zawawi <zeus_go64@hotmail.com> on October 28, 2000.
+ ** First working version contributed by Ahmad Zawawi <ahmad.zawawi@gmail.com> on October 28, 2000.
** i created this lexer because i needed something pretty when dealing
** when Apache Configuration files...
**/
diff --git a/scintilla/lexers/LexLua.cxx b/scintilla/lexers/LexLua.cxx
index c115192..1205725 100644
--- a/scintilla/lexers/LexLua.cxx
+++ b/scintilla/lexers/LexLua.cxx
@@ -59,7 +59,7 @@ static void ColouriseLuaDoc(
// Accepts accented characters
CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
- CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true);
+ CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
// Not exactly following number definition (several dots are seen as OK, etc.)
// but probably enough in most cases. [pP] is for hex floats.
CharacterSet setNumber(CharacterSet::setDigits, ".-+abcdefpABCDEFP");
@@ -71,7 +71,7 @@ static void ColouriseLuaDoc(
// Initialize long string [[ ... ]] or block comment --[[ ... ]] nesting level,
// if we are inside such a string. Block comment was introduced in Lua 5.0,
// blocks with separators [=[ ... ]=] in Lua 5.1.
- // Continuation of a string (\* whitespace escaping) is controlled by stringWs.
+ // Continuation of a string (\z whitespace escaping) is controlled by stringWs.
int nestLevel = 0;
int sepCount = 0;
int stringWs = 0;
@@ -130,6 +130,61 @@ static void ColouriseLuaDoc(
// Determine if the current state should terminate.
if (sc.state == SCE_LUA_OPERATOR) {
+ if (sc.ch == ':' && sc.chPrev == ':') { // :: <label> :: forward scan
+ sc.Forward();
+ int ln = 0, maxln = startPos + length - sc.currentPos;
+ int c;
+ while (ln < maxln) { // determine line extent
+ c = sc.GetRelative(ln);
+ if (c == '\r' || c == '\n')
+ break;
+ ln++;
+ }
+ maxln = ln; ln = 0;
+ while (ln < maxln) { // skip over spaces/tabs
+ if (!IsASpaceOrTab(sc.GetRelative(ln)))
+ break;
+ ln++;
+ }
+ int ws1 = ln;
+ if (setWordStart.Contains(sc.GetRelative(ln))) {
+ int i = 0;
+ char s[100];
+ while (ln < maxln) { // get potential label
+ c = sc.GetRelative(ln);
+ if (!setWord.Contains(c))
+ break;
+ if (i < 90)
+ s[i++] = c;
+ ln++;
+ }
+ s[i] = '\0'; int lbl = ln;
+ if (!keywords.InList(s)) {
+ while (ln < maxln) { // skip over spaces/tabs
+ if (!IsASpaceOrTab(sc.GetRelative(ln)))
+ break;
+ ln++;
+ }
+ int ws2 = ln - lbl;
+ if (sc.GetRelative(ln) == ':' && sc.GetRelative(ln + 1) == ':') {
+ // final :: found, complete valid label construct
+ sc.ChangeState(SCE_LUA_LABEL);
+ if (ws1) {
+ sc.SetState(SCE_LUA_DEFAULT);
+ sc.Forward(ws1);
+ }
+ sc.SetState(SCE_LUA_LABEL);
+ sc.Forward(lbl - ws1);
+ if (ws2) {
+ sc.SetState(SCE_LUA_DEFAULT);
+ sc.Forward(ws2);
+ }
+ sc.SetState(SCE_LUA_LABEL);
+ sc.Forward(2);
+ }
+ }
+ }
+ }
sc.SetState(SCE_LUA_DEFAULT);
} else if (sc.state == SCE_LUA_NUMBER) {
// We stop the number definition on non-numerical non-dot non-eEpP non-sign non-hexdigit char
@@ -140,11 +195,26 @@ static void ColouriseLuaDoc(
sc.SetState(SCE_LUA_DEFAULT);
}
} else if (sc.state == SCE_LUA_IDENTIFIER) {
- if (!setWord.Contains(sc.ch) || sc.Match('.', '.')) {
+ if (!(setWord.Contains(sc.ch) || sc.ch == '.') || sc.Match('.', '.')) {
char s[100];
sc.GetCurrent(s, sizeof(s));
if (keywords.InList(s)) {
sc.ChangeState(SCE_LUA_WORD);
+ if (strcmp(s, "goto") == 0) { // goto <label> forward scan
+ sc.SetState(SCE_LUA_DEFAULT);
+ while (IsASpaceOrTab(sc.ch) && !sc.atLineEnd)
+ sc.Forward();
+ if (setWordStart.Contains(sc.ch)) {
+ sc.SetState(SCE_LUA_LABEL);
+ sc.Forward();
+ while (setWord.Contains(sc.ch))
+ sc.Forward();
+ sc.GetCurrent(s, sizeof(s));
+ if (keywords.InList(s))
+ sc.ChangeState(SCE_LUA_WORD);
+ }
+ sc.SetState(SCE_LUA_DEFAULT);
+ }
} else if (keywords2.InList(s)) {
sc.ChangeState(SCE_LUA_WORD2);
} else if (keywords3.InList(s)) {
@@ -174,7 +244,7 @@ static void ColouriseLuaDoc(
if (sc.ch == '\\') {
if (setEscapeSkip.Contains(sc.chNext)) {
sc.Forward();
- } else if (sc.chNext == '*') {
+ } else if (sc.chNext == 'z') {
sc.Forward();
stringWs = 0x100;
}
@@ -192,7 +262,7 @@ static void ColouriseLuaDoc(
if (sc.ch == '\\') {
if (setEscapeSkip.Contains(sc.chNext)) {
sc.Forward();
- } else if (sc.chNext == '*') {
+ } else if (sc.chNext == 'z') {
sc.Forward();
stringWs = 0x100;
}
@@ -269,7 +339,7 @@ static void ColouriseLuaDoc(
}
}
- if (setWord.Contains(sc.chPrev)) {
+ if (setWord.Contains(sc.chPrev) || sc.chPrev == '.') {
char s[100];
sc.GetCurrent(s, sizeof(s));
if (keywords.InList(s)) {
diff --git a/scintilla/lexers/LexMagik.cxx b/scintilla/lexers/LexMagik.cxx
index 1dda7a3..ae7fb2b 100644
--- a/scintilla/lexers/LexMagik.cxx
+++ b/scintilla/lexers/LexMagik.cxx
@@ -233,7 +233,7 @@ static void ColouriseMagikDoc(unsigned int startPos, int length, int initStyle,
}
if(characters.InList(keyword)) {
- sc.Forward(strlen(keyword));
+ sc.Forward(static_cast<int>(strlen(keyword)));
} else {
sc.Forward();
}
diff --git a/scintilla/lexers/LexModula.cxx b/scintilla/lexers/LexModula.cxx
index 1944f2b..f07f568 100644
--- a/scintilla/lexers/LexModula.cxx
+++ b/scintilla/lexers/LexModula.cxx
@@ -92,7 +92,7 @@ static inline bool checkStatement(
Accessor &styler,
int &curPos,
const char *stt, bool spaceAfter = true ) {
- int len = strlen( stt );
+ int len = static_cast<int>(strlen( stt ));
int i;
for( i = 0; i < len; i++ ) {
if( styler.SafeGetCharAt( curPos + i ) != stt[i] ) {
@@ -113,7 +113,7 @@ static inline bool checkEndSemicolon(
int &curPos, int endPos )
{
const char *stt = "END";
- int len = strlen( stt );
+ int len = static_cast<int>(strlen( stt ));
int i;
for( i = 0; i < len; i++ ) {
if( styler.SafeGetCharAt( curPos + i ) != stt[i] ) {
diff --git a/scintilla/lexers/LexPerl.cxx b/scintilla/lexers/LexPerl.cxx
index 0d37cd5..e6365e5 100644
--- a/scintilla/lexers/LexPerl.cxx
+++ b/scintilla/lexers/LexPerl.cxx
@@ -246,14 +246,6 @@ static bool styleCheckSubPrototype(LexAccessor &styler, unsigned int bk) {
return true;
}
-static bool isMatch(const char *sref, char *s) {
- // match per-line delimiter - must kill trailing CR if CRLF
- int i = static_cast<int>(strlen(s));
- if (i != 0 && s[i - 1] == '\r')
- s[i - 1] = '\0';
- return (strcmp(sref, s) == 0);
-}
-
static int actualNumStyle(int numberStyle) {
if (numberStyle == PERLNUM_VECTOR || numberStyle == PERLNUM_V_VECTOR) {
return SCE_PL_STRING;
@@ -773,16 +765,17 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
case SCE_PL_HERE_QX: {
// also implies HereDoc.State == 2
sc.Complete();
- while (!sc.atLineEnd)
- sc.Forward();
- char s[HERE_DELIM_MAX];
- sc.GetCurrent(s, sizeof(s));
- if (isMatch(HereDoc.Delimiter, s)) {
+ if (HereDoc.DelimiterLength == 0 || sc.Match(HereDoc.Delimiter)) {
+ sc.Forward(HereDoc.DelimiterLength);
+ if (sc.atLineEnd || ((sc.ch == '\r' && sc.chNext == '\n'))) {
sc.SetState(SCE_PL_DEFAULT);
backFlag = BACK_NONE;
HereDoc.State = 0;
}
}
+ while (!sc.atLineEnd)
+ sc.Forward();
+ }
break;
case SCE_PL_POD:
case SCE_PL_POD_VERB: {
@@ -910,13 +903,14 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
break;
case SCE_PL_FORMAT: {
sc.Complete();
- while (!sc.atLineEnd)
+ if (sc.Match('.')) {
sc.Forward();
- char s[10];
- sc.GetCurrent(s, sizeof(s));
- if (isMatch(".", s))
+ if (sc.atLineEnd || ((sc.ch == '\r' && sc.chNext == '\n')))
sc.SetState(SCE_PL_DEFAULT);
}
+ while (!sc.atLineEnd)
+ sc.Forward();
+ }
break;
case SCE_PL_ERROR:
break;
@@ -1127,7 +1121,6 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
bool isHereDoc = sc.Match('<', '<');
bool hereDocSpace = false; // for: SCALAR [whitespace] '<<'
unsigned int bk = (sc.currentPos > 0) ? sc.currentPos - 1: 0;
- unsigned int bkend;
sc.Complete();
styler.Flush();
if (styler.StyleAt(bk) == SCE_PL_DEFAULT)
@@ -1196,7 +1189,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
// keywords always forced as /PATTERN/: split, if, elsif, while
// everything else /PATTERN/ unless digit/space immediately after '/'
// for '//', defined-or favoured unless special keywords
- bkend = bk + 1;
+ unsigned int bkend = bk + 1;
while (bk > 0 && styler.StyleAt(bk - 1) == SCE_PL_WORD) {
bk--;
}
diff --git a/scintilla/lexers/LexPowerPro.cxx b/scintilla/lexers/LexPowerPro.cxx
index 3912395..516b678 100644
--- a/scintilla/lexers/LexPowerPro.cxx
+++ b/scintilla/lexers/LexPowerPro.cxx
@@ -155,7 +155,7 @@ static void ColourisePowerProDoc(unsigned int startPos, int length, int initStyl
if ((sc.ch > 0) && setWord.Contains(sc.ch))
{
strcpy(s_save,s);
- int tp = strlen(s_save);
+ int tp = static_cast<int>(strlen(s_save));
if (tp < 99) {
s_save[tp] = static_cast<char>(tolower(sc.ch));
s_save[tp+1] = '\0';
diff --git a/scintilla/lexers/LexTeX.cxx b/scintilla/lexers/LexTeX.cxx
index ec859a3..66f3233 100644
--- a/scintilla/lexers/LexTeX.cxx
+++ b/scintilla/lexers/LexTeX.cxx
@@ -222,7 +222,7 @@ static void ColouriseTeXDoc(
sc.ForwardSetState(SCE_TEX_TEXT) ;
} else {
sc.GetCurrent(key, sizeof(key)-1) ;
- k = strlen(key) ;
+ k = static_cast<int>(strlen(key)) ;
memmove(key,key+1,k) ; // shift left over escape token
key[k] = '\0' ;
k-- ;
diff --git a/scintilla/lexers/LexVHDL.cxx b/scintilla/lexers/LexVHDL.cxx
index 20d1832..982f414 100644
--- a/scintilla/lexers/LexVHDL.cxx
+++ b/scintilla/lexers/LexVHDL.cxx
@@ -235,7 +235,7 @@ static void FoldNoBoxVHDLDoc(
}
}
}
- for(j=j+strlen(prevWord); j<endPos; j++)
+ for(j=j+static_cast<unsigned int>(strlen(prevWord)); j<endPos; j++)
{
char ch = styler.SafeGetCharAt(j);
int style = styler.StyleAt(j);