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 | db6528b463841e9ea05fb9dad1559d263b1f6a34 (patch) | |
| tree | 0131d0de33a0ecabadf7d81ebe3d3a50551642e8 /lexlib/SubStyles.h | |
| parent | ff97c84526a6105c8371cc75333053640b4b4ccb (diff) | |
| download | scintilla-mirror-db6528b463841e9ea05fb9dad1559d263b1f6a34.tar.gz | |
Backport: Implement style metadata for some languages.
Add some helper methods to SubStyles for finding style metadata of substyles.
Backport of changeset 6349:f350a2543488.
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) | 
