diff options
author | nyamatongwe <unknown> | 2006-02-13 10:07:45 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2006-02-13 10:07:45 +0000 |
commit | 51b92fd825247ad528b506926c902ca8a347cb20 (patch) | |
tree | 7947b07f6323e4ff58324fdc9abbb96b3b370d16 /src | |
parent | 6c4547f4550843ce9a4c88d68735b9db131cb677 (diff) | |
download | scintilla-mirror-51b92fd825247ad528b506926c902ca8a347cb20.tar.gz |
Patch from Kein-Hong Man to allow more forms of numeric literal.
Diffstat (limited to 'src')
-rw-r--r-- | src/LexLua.cxx | 8 |
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 == '\"') { |