aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2006-02-13 10:07:45 +0000
committernyamatongwe <devnull@localhost>2006-02-13 10:07:45 +0000
commit1d028e14a7a945ed489e60b67c9733b16b1b4676 (patch)
tree7947b07f6323e4ff58324fdc9abbb96b3b370d16
parent0fe8306ffa7c79774286eb2f015ec69372297203 (diff)
downloadscintilla-mirror-1d028e14a7a945ed489e60b67c9733b16b1b4676.tar.gz
Patch from Kein-Hong Man to allow more forms of numeric literal.
-rw-r--r--src/LexLua.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/LexLua.cxx b/src/LexLua.cxx
index 169d3f4f8..b3a46ad34 100644
--- a/src/LexLua.cxx
+++ b/src/LexLua.cxx
@@ -38,7 +38,8 @@ static inline bool IsANumberChar(int ch) {
// but probably enough in most cases.
return (ch < 0x80) &&
(isdigit(ch) || toupper(ch) == 'E' ||
- ch == '.' || ch == '-' || ch == '+');
+ ch == '.' || ch == '-' || ch == '+' ||
+ (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'));
}
static inline bool IsLuaOperator(int ch) {
@@ -145,7 +146,7 @@ static void ColouriseLuaDoc(
if (sc.state == SCE_LUA_OPERATOR) {
sc.SetState(SCE_LUA_DEFAULT);
} else if (sc.state == SCE_LUA_NUMBER) {
- // We stop the number definition on non-numerical non-dot non-eE non-sign char
+ // We stop the number definition on non-numerical non-dot non-eE non-sign non-hexdigit char
if (!IsANumberChar(sc.ch)) {
sc.SetState(SCE_LUA_DEFAULT);
}
@@ -226,6 +227,9 @@ static void ColouriseLuaDoc(
if (sc.state == SCE_LUA_DEFAULT) {
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_LUA_NUMBER);
+ if (sc.ch == '0' && toupper(sc.chNext) == 'X') {
+ sc.Forward(1);
+ }
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_LUA_IDENTIFIER);
} else if (sc.ch == '\"') {