diff options
author | Joe Mueller <unknown> | 2015-07-30 14:35:17 +1000 |
---|---|---|
committer | Joe Mueller <unknown> | 2015-07-30 14:35:17 +1000 |
commit | 58471e908a3b74b27379bb19a13d62cd8d4476b0 (patch) | |
tree | 8f61293f34d008fea20584c631d23e58b3fe53aa /lexers/LexCaml.cxx | |
parent | 2270ab97445c6f12bd0fddb273ab617fdb421594 (diff) | |
download | scintilla-mirror-58471e908a3b74b27379bb19a13d62cd8d4476b0.tar.gz |
Use Sci_Position / Sci_PositionU for variables in lexers that represent
positions and line numbers and may be widened to 64-bits in a future release.
Diffstat (limited to 'lexers/LexCaml.cxx')
-rw-r--r-- | lexers/LexCaml.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lexers/LexCaml.cxx b/lexers/LexCaml.cxx index 4cc0bd7df..df8781541 100644 --- a/lexers/LexCaml.cxx +++ b/lexers/LexCaml.cxx @@ -188,7 +188,8 @@ void ColouriseCamlDoc( // initialize styler StyleContext sc(startPos, length, initStyle, styler); - int chBase = 0, chToken = 0, chLit = 0; + Sci_PositionU chToken = 0; + int chBase = 0, chLit = 0; WordList& keywords = *keywordlists[0]; WordList& keywords2 = *keywordlists[1]; WordList& keywords3 = *keywordlists[2]; @@ -206,7 +207,7 @@ void ColouriseCamlDoc( while (sc.More()) { // set up [per-char] state info int state2 = -1; // (ASSUME no state change) - int chColor = sc.currentPos - 1;// (ASSUME standard coloring range) + Sci_Position chColor = sc.currentPos - 1;// (ASSUME standard coloring range) bool advance = true; // (ASSUME scanner "eats" 1 char) // step state machine @@ -254,11 +255,11 @@ void ColouriseCamlDoc( case SCE_CAML_IDENTIFIER: // [try to] interpret as [additional] identifier char if (!(iscaml(sc.ch) || sc.Match('\''))) { - const int n = sc.currentPos - chToken; + const Sci_Position n = sc.currentPos - chToken; if (n < 24) { // length is believable as keyword, [re-]construct token char t[24]; - for (int i = -n; i < 0; i++) + for (Sci_Position i = -n; i < 0; i++) t[n + i] = static_cast<char>(sc.GetRelative(i)); t[n] = '\0'; // special-case "_" token as KEYWORD @@ -390,7 +391,7 @@ void ColouriseCamlDoc( state2 = SCE_CAML_STRING, sc.ch = ' ' /* (...\") */, chColor++, styler.ColourTo(chColor, SCE_CAML_WHITE), styler.Flush(); // ... then backtrack to determine original SML literal type - int p = chColor - 2; + Sci_Position p = chColor - 2; for (; p >= 0 && styler.StyleAt(p) == SCE_CAML_WHITE; p--) ; if (p >= 0) state2 = static_cast<int>(styler.StyleAt(p)); @@ -437,7 +438,7 @@ void ColouriseCamlDoc( static #endif /* BUILD_AS_EXTERNAL_LEXER */ void FoldCamlDoc( - unsigned int, int, + Sci_PositionU, Sci_Position, int, WordList *[], Accessor &) |