diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2016-02-17 15:31:18 +0100 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2016-02-17 15:31:18 +0100 |
commit | 8cb3d9c412f1d09f0f4c94df84ff980f3e83c949 (patch) | |
tree | a54514003ee315afe0b9beea4dc2bb1ddcdd6d28 /lexers/LexRuby.cxx | |
parent | 18aec260b1c78b1a62dd467177a983ac4e9a798b (diff) | |
download | scintilla-mirror-8cb3d9c412f1d09f0f4c94df84ff980f3e83c949.tar.gz |
Ruby: Allow a symbol before a HereDoc for an implicit hash argument
Part of bug [#1810].
Diffstat (limited to 'lexers/LexRuby.cxx')
-rw-r--r-- | lexers/LexRuby.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lexers/LexRuby.cxx b/lexers/LexRuby.cxx index e4fd575fe..092f71dd0 100644 --- a/lexers/LexRuby.cxx +++ b/lexers/LexRuby.cxx @@ -504,6 +504,16 @@ static bool sureThisIsNotHeredoc(Sci_Position lt2StartPos, } // Skip next batch of white-space firstWordPosn = skipWhitespace(firstWordPosn, lt2StartPos, styler); + // possible symbol for an implicit hash argument + if (firstWordPosn < lt2StartPos && styler.StyleAt(firstWordPosn) == SCE_RB_SYMBOL) { + for (; firstWordPosn <= lt2StartPos; firstWordPosn += 1) { + if (styler.StyleAt(firstWordPosn) != SCE_RB_SYMBOL) { + break; + } + } + // Skip next batch of white-space + firstWordPosn = skipWhitespace(firstWordPosn, lt2StartPos, styler); + } if (firstWordPosn != lt2StartPos) { // Have [[^ws[identifier]ws[*something_else*]ws<< return definitely_not_a_here_doc; |