diff options
author | Neil <nyamatongwe@gmail.com> | 2017-07-17 14:37:48 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-07-17 14:37:48 +1000 |
commit | 53a6f96afabcb3c307f8955b6f633aa8d5608624 (patch) | |
tree | b90f78b8bd0deeaf87a87b35e7e689f3004f8af1 /lexlib/SubStyles.h | |
parent | 8fe23071ec3f82bf2b602f2ba5edee0cf6bc6fa3 (diff) | |
download | scintilla-mirror-53a6f96afabcb3c307f8955b6f633aa8d5608624.tar.gz |
Implement style metadata for some languages.
Add some helper methods to SubStyles for finding style metadata of substyles.
Diffstat (limited to 'lexlib/SubStyles.h')
-rw-r--r-- | lexlib/SubStyles.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lexlib/SubStyles.h b/lexlib/SubStyles.h index f5b15e9cf..07b0f1507 100644 --- a/lexlib/SubStyles.h +++ b/lexlib/SubStyles.h @@ -37,6 +37,10 @@ public: return firstStyle; } + int Last() const { + return firstStyle + lenStyles - 1; + } + int Length() const { return lenStyles; } @@ -153,6 +157,24 @@ public: return secondaryDistance; } + int FirstAllocated() const { + int start = 257; + for (std::vector<WordClassifier>::const_iterator it = classifiers.begin(); it != classifiers.end(); ++it) { + if (start > it->Start()) + start = it->Start(); + } + return (start < 256) ? start : -1; + } + + int LastAllocated() const { + int last = -1; + for (std::vector<WordClassifier>::const_iterator it = classifiers.begin(); it != classifiers.end(); ++it) { + if (last < it->Last()) + last = it->Last(); + } + return last; + } + void SetIdentifiers(int style, const char *identifiers) { int block = BlockFromStyle(style); if (block >= 0) |