aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexPascal.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lexers/LexPascal.cxx')
-rw-r--r--lexers/LexPascal.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/lexers/LexPascal.cxx b/lexers/LexPascal.cxx
index 867b00ea6..1e2be2318 100644
--- a/lexers/LexPascal.cxx
+++ b/lexers/LexPascal.cxx
@@ -54,6 +54,8 @@ are ignored as fold points
4. Every other situation when class keyword doesn't actually start class
declaration ("class procedure", "class function", "class of", "class var",
"class property" and "class operator")
+5. Forward (disp)interface declarations ("type IMyInterface = interface;") are
+ignored as fold points
- Folding of code blocks inside preprocessor blocks is disabled (any comments
inside them will be folded fine) because there is no guarantee that complete
@@ -484,6 +486,24 @@ static void ClassifyPascalWordFoldPoint(int &levelCurrent, int &lineFoldStateCur
ignoreKeyword = false;
}
if (!ignoreKeyword) {
+ unsigned int k = SkipWhiteSpace(currentPos, endPos, styler);
+ if (k < endPos && styler.SafeGetCharAt(k) == ';') {
+ // Handle forward interface declarations ("type IMyInterface = interface;")
+ ignoreKeyword = true;
+ }
+ }
+ if (!ignoreKeyword) {
+ levelCurrent++;
+ }
+ } else if (strcmp(s, "dispinterface") == 0) {
+ // "dispinterface" keyword requires special handling...
+ bool ignoreKeyword = false;
+ unsigned int j = SkipWhiteSpace(currentPos, endPos, styler);
+ if (j < endPos && styler.SafeGetCharAt(j) == ';') {
+ // Handle forward dispinterface declarations ("type IMyInterface = dispinterface;")
+ ignoreKeyword = true;
+ }
+ if (!ignoreKeyword) {
levelCurrent++;
}
} else if (strcmp(s, "end") == 0) {