aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexRuby.cxx
diff options
context:
space:
mode:
authorColomban Wendling <ban@herbesfolles.org>2012-09-13 16:23:15 +0200
committerColomban Wendling <ban@herbesfolles.org>2012-09-13 16:23:15 +0200
commit2a32bdcc5e67b568516e9016b9f787510483a500 (patch)
treed5995b49d3c8d60f34d485d9e77dd02f227a1fa8 /lexers/LexRuby.cxx
parenta4d5e79127d5a91c4bda09990426611f4d4cfbdb (diff)
downloadscintilla-mirror-2a32bdcc5e67b568516e9016b9f787510483a500.tar.gz
Fix folding of "for" Ruby loops
The "for" loops can end with a "do" keyword, and this "do" shouldn't start its own scope.
Diffstat (limited to 'lexers/LexRuby.cxx')
-rw-r--r--lexers/LexRuby.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/lexers/LexRuby.cxx b/lexers/LexRuby.cxx
index 23115e6e0..22364c19c 100644
--- a/lexers/LexRuby.cxx
+++ b/lexers/LexRuby.cxx
@@ -1436,7 +1436,8 @@ static bool keywordIsAmbiguous(const char *prevWord)
|| !strcmp(prevWord, "do")
|| !strcmp(prevWord, "while")
|| !strcmp(prevWord, "unless")
- || !strcmp(prevWord, "until")) {
+ || !strcmp(prevWord, "until")
+ || !strcmp(prevWord, "for")) {
return true;
} else {
return false;
@@ -1554,6 +1555,7 @@ static bool keywordIsModifier(const char *word,
#define WHILE_BACKWARDS "elihw"
#define UNTIL_BACKWARDS "litnu"
+#define FOR_BACKWARDS "rof"
// Nothing fancy -- look to see if we follow a while/until somewhere
// on the current line
@@ -1591,7 +1593,8 @@ static bool keywordDoStartsLoop(int pos,
*dst = 0;
// Did we see our keyword?
if (!strcmp(prevWord, WHILE_BACKWARDS)
- || !strcmp(prevWord, UNTIL_BACKWARDS)) {
+ || !strcmp(prevWord, UNTIL_BACKWARDS)
+ || !strcmp(prevWord, FOR_BACKWARDS)) {
return true;
}
// We can move pos to the beginning of the keyword, and then